Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Refixed issue with parsing desired capabilities

Reapplied fix to handle colon within a value for the desired capabilities.
This had been fixed but the bug was reintroduced somewhere. Added unittest
to check for complex desired capabilities string.
  • Loading branch information...
commit 264fda7592a078fe54df7990940c59ca56e9073c 1 parent 5ce5409
Ed Manlove emanlove authored
2  src/Selenium2Library/keywords/_browsermanagement.py
View
@@ -570,7 +570,7 @@ def _parse_capabilities_string(self, capabilities_string):
return desired_capabilities
for cap in capabilities_string.split(","):
- (key, value) = cap.split(":")
+ (key, value) = cap.split(":", 1)
desired_capabilities[key.strip()] = value.strip()
return desired_capabilities
8 test/unit/keywords/test_browsermanagement.py
View
@@ -52,6 +52,14 @@ def test_parse_capabilities_string(self):
self.assertTrue("val2", capabilities["key2"])
self.assertTrue(2, len(capabilities))
+ def test_parse_complex_capabilities_string(self):
+ bm = _BrowserManagementKeywords()
+ expected_caps = "proxyType:manual,httpProxy:IP:port"
+ capabilities = bm._parse_capabilities_string(expected_caps)
+ self.assertTrue("manual", capabilities["proxyType"])
+ self.assertTrue("IP:port", capabilities["httpProxy"])
+ self.assertTrue(2, len(capabilities))
+
def test_create_remote_browser_with_desired_prefs(self):
expected_caps = {"key1":"val1","key2":"val2"}
self.verify_browser(webdriver.Remote, "chrome", remote="http://127.0.0.1/wd/hub",
Please sign in to comment.
Something went wrong with that request. Please try again.