Modifying Session Request Parameters Globally - RickStrahl/WestWindWebSurge GitHub Wiki
Often times when you capture or create load testing data, you capture the data on a test or staging machine. At a later point in time you then decide that you'd like to run the tests against a different machine - say a dev machine or a live server. Also when you capture request data often times you capture a specific snapshot in time - for example you might capture authorization headers or cookies that are validated for when you actually captured the requests, but may not be valid any longer when you replay the tests.
WebSurge provides a number of Request Override parameters as part of the Options page which allows you to modify a number of operational parameters as requests are played back. You can override:
- Domain Name
- Cookies
- Authorization Header
- QueryString Values
You can find these settings on the Session Options
tab in the Header Replacement
section. These settings are applied as requests are played back for individual URL tests or when load testing, leaving the original values set on the requests that are stored in the configuration file. In other words, these setting overrides are non-destructive.
If you make changes to these settings and you want to save them be sure to click the Save button on the settings toolbar, which persists these changes along with any requests in the session.
Domain Name
Using this option allows you to easily create tests on one machine, and move them over to another machine to run at a later point.
Using this setting you can override the captured request domain name with a different domain name or virtual path. For example, you may capture your initial requests on a local machine using http://localhost/, but the later when you run the test against a staging machine you might run against http://staging.mygreatapp.com/ or maybe on another dev machine where you are not using a root web like http://localhost/myvirtual/.
For both cases you can replace the original domain name (localhost) with the new domain name or domain name plus virtual - staging.mygreatapp.com and localhost/myvirtual respectively for the examples above. Please note that the replacement value should not contain the final slash.
Cookie Header
Cookies are often used for authentication and user tracking, and so if you capture requests with cookie values eventually these cookie values get out of date and expire. The result is that requests no longer work.
The Cookies override allows you to replace the Cookie value used with a different cookie value that is current and will work on requests. To get a new valid cookie value you can log in to your site, then use a URL capture tool like Fiddler or your browser's developer tools to capture the new Cookie value. Copy the cookie value and simply paste it into the cookie value for the Cookie Session option.
Now when you run requests the new cookie value is used.
Authorization Header
Similar to the Cookie header, you can also override the Authorization header. As with cookies the value of the authorization might change if you're using bearer tokens in API calls for example, or authorization for Windows or Digest authentication.
QueryString Values
You can also override individual query string values using the ReplaceQueryStringValuePairs option. To use this option simply provide the query string values you want to have set on the request by providing one or more query string value pairs in the following format:
Key1=value&key2=value2&key3=value3
If the query string key is found on a given request the value is replaced, if the value doesn't exist it's added to the query string.
This option allows you to add user based keys or localization flags that might be controlled for all requests in a session. Keep in mind these overrides are applied to all requests that are fired on sessions.