Skip to content

Commit

Permalink
Update python driver to handle the new element key 'element-6066-11e4…
Browse files Browse the repository at this point in the history
…-a52e-4f735466cecf'
  • Loading branch information
AutomatedTester committed Mar 3, 2015
1 parent 2856585 commit d5b792d
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions py/selenium/webdriver/remote/webdriver.py
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,7 @@ def _wrap_value(self, value):
converted[key] = self._wrap_value(val)
return converted
elif isinstance(value, WebElement):
return {'ELEMENT': value.id}
return {'ELEMENT': value.id, 'element-6066-11e4-a52e-4f735466cecf': value.id}
elif isinstance(value, list):
return list(self._wrap_value(item) for item in value)
else:
Expand All @@ -145,8 +145,13 @@ def create_web_element(self, element_id):
return WebElement(self, element_id)

def _unwrap_value(self, value):
if isinstance(value, dict) and 'ELEMENT' in value:
return self.create_web_element(value['ELEMENT'])
if isinstance(value, dict) and ('ELEMENT' in value or 'element-6066-11e4-a52e-4f735466cecf' in value):
wrapped_id = value.get('ELEMENT', None)
if wrapped_id:
return self.create_web_element(value['ELEMENT'])
else:
return self.create_web_element(value['element-6066-11e4-a52e-4f735466cecf'])

elif isinstance(value, list):
return list(self._unwrap_value(item) for item in value)
else:
Expand Down

0 comments on commit d5b792d

Please sign in to comment.