Knowledge Base

cancel
Showing results for 
Search instead for 
Did you mean: 

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

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
Revision #:
5 of 5
Last update:
‎09-07-2018 09:31 AM
Updated by:
 
Labels (1)


Found this article helpful? Click the Thumbs Up button.
Have an additional comment? Post it below.
0 Kudos