Compartilhar via


How to handle dynamic values in String Body - VSTS Web /Load Testing

How to handle dynamic values in String Body - VSTS Web Testing

Dynamic values can be identified during webtest script execution. Most of the time these values are returned from WEB server. In order to make our web scripts to work –we can do following things

1. Extract manually these values to a variable using VSTS web test extraction rules

Extract dynamic values using extraction rules in previous requests -identify the first request which returns the required value.

In order to that Play webtest once, read response body and add extraction rule as appropriate.

Note: Use fiddler when you are recording the script, so that you can match exact value in String Body.

Substitute this value as using {{….. }} as shown below. This value should be provided using {{ }} rest of the notations like “, , ; everything should remain as is.

2. Write plugin using built in web/load test api’s incase if you need to handle more values

Incase if you have more values to be extracted and supplied in String Body or in any other places. Then I advise writing custom plugins using Web/Load test test API’s. This I will cover in my next post.