Note: This statement is only used in load test scripts. See Load Testing for more information.
Overrides the browser user agent sent by the client with a custom user agent.
Some web pages may change behavior depending on the browser. The user agent string is passed to the application to identify the browser. You can create custom agents to simulate different browser versions or automated web crawlers for searches.
Syntax
WebSetUserAgent("UserAgent")
Arguments
| Argument | Description |
|---|---|
| UserAgent | User agent to send. |
Tip: To view a list of user agent constants, choose Script > Add Statement and select this statement in the Load Testing category. To find a user agent string, choose Script > Run Load Test and click Add in the Browsers area. Select a Browser in the Add Browser dialog box and copy the User Agent string to the statement argument.
Example
WebSetUserAgent("USERAGENT_FIREFOX2")