cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Gaurav.Soni
AppDynamics Team (Retired)

Question

How can I customize the user agent used by the Synthetic browser?

 

Environment 

Synthetic agent v4.4 

 

Answer

We introduced a way to configure the Synthetic Agent through in-script metadata, which is basically a way to configure the Synthetic Agent directly for hidden configuration flags or features not yet available through the UI. As an example, you can use this to set a custom user agent.

 

IMPORTANT NOTE: The metadata is yml, enclosed in a python comment block starting on the very first line of the script.

 

 

'''yml
requestHeader:
  userAgent: "Mozilla/5.0 (iPhone; CPU iPhone OS 10_1_1 like Mac OS X) AppleWebKit/602.1.32 (KHTML, like Gecko) Mobile/14B100 Twitter for iPhone"
'''
driver.get("http://www.mysite.com")

 

Version history
Last update:
‎09-07-2018 09:31 AM
Updated by: