2

I've been following wiki to setup safari extension for Selenium 2.48.0:

This works mostly, but occasionally getting some weird errors in my tests scripts (that are written in Ruby/Capybara) like:

Selenium::WebDriver::Error::NoSuchElementError:
       Selenium::WebDriver::Error::NoSuchElementError
     # /Users/admin/.rvm/gems/ruby-2.2.1/gems/selenium-webdriver-2.53.0/lib/selenium/webdriver/common/search_context.rb:64:in `rescue in find_element'
     # /Users/admin/.rvm/gems/ruby-2.2.1/gems/selenium-webdriver-2.53.0/lib/selenium/webdriver/common/search_context.rb:55:in `find_element'
     # ./lib/about.rb:94:in `click_read_more_work'
     # ./spec/check_about_links.rb:91:in `block (3 levels) in <top (required)>'
     # ------------------
     # --- Caused by: ---
     # IO::EAGAINWaitReadable:
     #   Resource temporarily unavailable - read would block
     #   /Users/admin/.rvm/gems/ruby-2.2.1/gems/selenium-webdriver-2.53.0/lib/selenium/webdriver/safari/server.rb:63:in `read_nonblock'

​and:

Selenium::WebDriver::Error::UnknownError:
       Session is executing: findElements; cannot set current to: findElements
     # /Users/admin/.rvm/gems/ruby-2.2.1/gems/selenium-webdriver-2.53.0/lib/selenium/webdriver/safari/bridge.rb:88:in `raw_execute'
     # /Users/admin/.rvm/gems/ruby-2.2.1/gems/selenium-webdriver-2.53.0/lib/selenium/webdriver/remote/bridge.rb:627:in `execute'
     # /Users/admin/.rvm/gems/ruby-2.2.1/gems/selenium-webdriver-2.53.0/lib/selenium/webdriver/remote/bridge.rb:606:in `find_elements_by'
     # /Users/admin/.rvm/gems/ruby-2.2.1/gems/selenium-webdriver-2.53.0/lib/selenium/webdriver/common/search_context.rb:84:in `find_elements'

Capybara is referred to the latest version of selenium webdriver gem: 2.53.0 but from my understanding of above's article, safari extension from Selenium 2.53.0 needs to exist in Safari browser as well.

This download link does not contain separate safari extension file:

in contrast to version 2.48.0 which does: http://selenium-release.storage.googleapis.com/index.html?path=2.48/

Is there something changed in the installing safari extension and am I missing something?

Note: Safari version is 9.1.1

Thanks in advance,

RichardBernards
  • 3,146
  • 1
  • 22
  • 30
Bakir Jusufbegovic
  • 2,806
  • 4
  • 32
  • 48

2 Answers2

2

Due to security changes in the past few years, you must manually install the Safari WebDriver extension on each target machine while logged in locally. You cannot automate this step. It must be a copy that has been built and code signed by a registered paid developer account since the last change in January of 2016.

Generally this means you should build it yourself.

Without this, it won't work.

It is worth noting the extension has had no official code changes in about two years.

It is also worth noting that Apple quietly announced Safari 10 to have a native SafariDriver, as part of the W3C WebDriver draft RFC requiring all browsers to provide the WebDriver portion of Selenium WebDriver.

uchuugaka
  • 12,679
  • 6
  • 37
  • 55
-1

Safari support in Selenium is far from being complete and working correctly. Also not every version of Selenium has changes in Safari driver that's why you should use the latest available version which is for the moment 2.48 and resides in respective directory of Selenium releases website.

vania-pooh
  • 2,933
  • 4
  • 24
  • 42