Forum Discussion

LearningTC's avatar
LearningTC
Occasional Contributor
9 years ago

Parametrize a post request in Text/plain form

Hi,

 

Is there a way to parametrize a post request which is in text/plain form?

since the details are not available in parameters tab.

 

Thanks,

LearningTC

2 Replies

  • Hi LearningTC,

     

    Yes! You can parameterize text in a request body by using data replacers (called "data modifiers" in LoadComplete 3.2 and earlier).

     

    First create a variable for the value(s) you want to parameterize. You can create a variable using external data, a static set of values, or values from server responses in your scenario (via data selectors).

     

    Then, you will create a data replacer for the request you want to parameterize by using a regular expression. If you're not familiar with regular expressions, it is syntax that allows you to select a specific string within a body of text. In this case, you will be using the regular expression to tell LoadComplete where to use the variable you created. Tools that will help you create and check regular expressions include regexr.com and the Data Selector Wizard in LoadComplete. We hope to add a similar wizard for data replacers in the future.

     

    Hope this helps!