Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Merge pull request #258 from ombre42/master

fixes #217 - copy desired capabilities before modifying
  • Loading branch information...
commit 5d42571ef0508e056af6ed8c6f9601e3cb2976ef 2 parents 064ef4e + 4586aee
Ed Manlove emanlove authored
2  src/Selenium2Library/keywords/_browsermanagement.py
View
@@ -550,7 +550,7 @@ def _create_remote_web_driver(self , capabilities_type , remote_url , desired_ca
'''parses the string based desired_capabilities if neccessary and
creates the associated remote web driver'''
- desired_capabilities_object = capabilities_type
+ desired_capabilities_object = capabilities_type.copy()
if type(desired_capabilities) in (str, unicode):
desired_capabilities = self._parse_capabilities_string(desired_capabilities)
6 test/unit/keywords/test_browsermanagement.py
View
@@ -70,6 +70,12 @@ def test_create_remote_browser_with_string_desired_prefs(self):
self.verify_browser(webdriver.Remote, "chrome", remote="http://127.0.0.1/wd/hub",
desired_capabilities=expected_caps)
+ def test_capabilities_attribute_not_modified(self):
+ expected_caps = {"some_cap":"42"}
+ self.verify_browser(webdriver.Remote, "chrome", remote="http://127.0.0.1/wd/hub",
+ desired_capabilities=expected_caps)
+ self.assertFalse("some_cap" in webdriver.DesiredCapabilities.CHROME)
+
def test_set_selenium_timeout_only_affects_open_browsers(self):
bm = _BrowserManagementKeywords()
first_browser, second_browser = mock(), mock()
Please sign in to comment.
Something went wrong with that request. Please try again.