File tree Expand file tree Collapse file tree 1 file changed +4
-3
lines changed
py/selenium/webdriver/remote Expand file tree Collapse file tree 1 file changed +4
-3
lines changed Original file line number Diff line number Diff line change 38
38
from io import BytesIO as IOStream
39
39
40
40
getAttribute_js = pkgutil .get_data (__package__ , 'getAttribute.js' ).decode ('utf8' )
41
+ isDisplayed_js = pkgutil .get_data (__package__ , 'isDisplayed.js' ).decode ('utf8' )
41
42
42
43
43
44
class WebElement (object ):
@@ -348,10 +349,10 @@ def send_keys(self, *value):
348
349
# RenderedWebElement Items
349
350
def is_displayed (self ):
350
351
"""Whether the element is visible to a user."""
351
- if self . _w3c :
352
- raw = pkgutil . get_data ( __package__ , 'isDisplayed.js' )
352
+ # Only go into this conditional for browsers that don't use the atom themselves
353
+ if self . _w3c and self . parent . capabilities [ 'browserName' ] == 'safari' :
353
354
return self .parent .execute_script (
354
- "return (%s).apply(null, arguments);" % raw ,
355
+ "return (%s).apply(null, arguments);" % isDisplayed_js ,
355
356
self )
356
357
else :
357
358
return self ._execute (Command .IS_ELEMENT_DISPLAYED )['value' ]
You can’t perform that action at this time.
0 commit comments