File tree Expand file tree Collapse file tree 1 file changed +4
-0
lines changed
Expand file tree Collapse file tree 1 file changed +4
-0
lines changed Original file line number Diff line number Diff line change @@ -79,6 +79,8 @@ def jsondump(data):
7979 'LOCATE_ELEMENT' : 30
8080}
8181
82+ TESTS_USER_AGENT = 'Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:43.0) Gecko/20100101 Firefox/43.0 codebender-selenium'
83+
8284# Set up Selenium Webdrivers to be used for selenium tests
8385def _get_firefox_profile ():
8486 """Returns the Firefox profile to be used for the FF webdriver.
@@ -147,6 +149,8 @@ def create_webdriver(command_executor, desired_capabilities):
147149 desired_capabilities = DesiredCapabilities .FIREFOX .copy ()
148150 desired_capabilities .update (_capabilities )
149151 browser_profile = _get_firefox_profile ()
152+ browser_profile .set_preference ("general.useragent.override" , TESTS_USER_AGENT )
153+ desired_capabilities ["firefox_profile" ] = browser_profile .update_preferences ()
150154 else :
151155 raise ValueError ("Invalid webdriver %s (only chrome and firefox are supported)" % browser_name )
152156 return webdriver .Remote (
You can’t perform that action at this time.
0 commit comments