Skip to content

Commit e87363f

Browse files
committed
Fix W3C check in WebElement.
The driver was changed in cefa1bf to look at the 'status' field, rather than 'specificationLevel', but 941ddb9 (which predates it, but was merged later) was doing it the old way. This also avoids changing the constructor signature.
1 parent 4326cb0 commit e87363f

File tree

2 files changed

+3
-4
lines changed

2 files changed

+3
-4
lines changed

py/selenium/webdriver/remote/webdriver.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -198,7 +198,7 @@ def create_web_element(self, element_id):
198198
"""
199199
Creates a web element with the specified element_id.
200200
"""
201-
return WebElement(self, element_id, capabilities=self.capabilities)
201+
return WebElement(self, element_id, w3c=self.w3c)
202202

203203
def _unwrap_value(self, value):
204204
if isinstance(value, dict) and ('ELEMENT' in value or 'element-6066-11e4-a52e-4f735466cecf' in value):

py/selenium/webdriver/remote/webelement.py

+2-3
Original file line numberDiff line numberDiff line change
@@ -53,11 +53,10 @@ class WebElement(object):
5353
'readonly', 'allowfullscreen', 'selected', 'formnovalidate',
5454
'multiple', 'autofocus', 'open', 'loop', 'autoplay']
5555

56-
def __init__(self, parent, id_, capabilities):
56+
def __init__(self, parent, id_, w3c=False):
5757
self._parent = parent
5858
self._id = id_
59-
self.capabilities = capabilities
60-
self._w3c = "specificationLevel" in self.capabilities
59+
self._w3c = w3c
6160

6261
def __repr__(self):
6362
return '<{0.__module__}.{0.__name__} (session="{1}", element="{2}")>'.format(

0 commit comments

Comments
 (0)