我一直在关注wiki为 Selenium 2.48.0 设置 safari 扩展:
这很有效,但偶尔会在我的测试脚本(用 Ruby/Capybara 编写)中出现一些奇怪的错误,例如:
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'
和:
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 指的是 selenium webdriver gem: 2.53.0 的最新版本,但根据我对上述文章的理解,来自 Selenium 2.53.0 的 safari 扩展也需要存在于 Safari 浏览器中。
此下载链接不包含单独的 Safari 扩展文件:
与版本 2.48.0 相比: http ://selenium-release.storage.googleapis.com/index.html?path=2.48/
安装 safari 扩展程序有什么变化吗?我错过了什么吗?
注意:Safari 版本为 9.1.1
提前致谢,