SafariDriver returning 'element not visible' exception for loaded element

Originator:tim
Number:rdar://36132458 Date Originated:December 19 2017
Status:Open Resolved:
Product:Safari Product Version:10.1 / 11.x
Classification:Bug Reproducible:Always
 
Summary:.
SafariDriver throwing "element not visible" exception on Safari 11.0(.x) on certain elements.

Steps to Reproduce:
Using a webdriver binding of your choice (this was tested with Python's selenium 3.8.0 package), and either a local safaridriver or via a Selenium server, get the website at https://amazon.com and do a search for an element with the class name `nav-cart-icon`.

Expected Results:
Safari should find the element and return it.

Actual Results:
Getting the following traceback using the Selenium Python bindings:
Traceback (most recent call last):
  File "./safari_window_element_repro.py", line 72, in <module>
    main()
  File "./safari_window_element_repro.py", line 60, in main
    safari_test()
  File "./safari_window_element_repro.py", line 50, in safari_test
    cart.click()
  File "/Users/timsutton/.virtualenvs/selenium-3.8.0/lib/python2.7/site-packages/selenium/webdriver/remote/webelement.py", line 80, in click
    self._execute(Command.CLICK_ELEMENT)
  File "/Users/timsutton/.virtualenvs/selenium-3.8.0/lib/python2.7/site-packages/selenium/webdriver/remote/webelement.py", line 501, in _execute
    return self._parent.execute(command, params)
  File "/Users/timsutton/.virtualenvs/selenium-3.8.0/lib/python2.7/site-packages/selenium/webdriver/remote/webdriver.py", line 311, in execute
    self.error_handler.check_response(response)
  File "/Users/timsutton/.virtualenvs/selenium-3.8.0/lib/python2.7/site-packages/selenium/webdriver/remote/errorhandler.py", line 237, in check_response
    raise exception_class(message, screen, stacktrace)
selenium.common.exceptions.ElementNotVisibleException: Message: An element command could not be completed because the element is not visible on the page.

There are some additional comments about window sizing in the repro script, as I've found these to not be reliable with Safari 10.1.x or 11. I just mention it because I noticed it here, although I'm not sure if it's in any way related.

This 'element not visible' error seems to be resolved in current 11.1 TP builds.

Version/Build:
11, 11.0.1, 11.0.2, 11.0.3 beta, macOS Sierra and High Sierra

Configuration:
Please see the Python repro script: https://gist.github.com/timsutton/e35fb7b9fbf261f388299facceb49400

Comments

Apple Developer Relations - December 21 2017, 4:16 AM

Engineering has determined that your bug report is a duplicate of another issue and will be closed. The open or closed status of the original report your bug was duplicated to appears in a text box within the bug detail section of the bug reporter user interface.

For security and privacy reasons, we don't provide access to the original bug yours was duped to. If you have any questions or concerns, please update your report directly at this link: https://bugreport.apple.com/.


Please note: Reports posted here will not necessarily be seen by Apple. All problems should be submitted at bugreport.apple.com before they are posted here. Please only post information for Radars that you have filed yourself, and please do not include Apple confidential information in your posts. Thank you!