【问题标题】:Selenium Ruby Webdriver unable to run Chrome browserSelenium Ruby Webdriver 无法运行 Chrome 浏览器
【发布时间】:2012-05-08 14:34:54
【问题描述】:

我正在尝试为 chrome 启动远程会话并不断遇到相同的问题。剧本没那么复杂。 我想知道是否不是某些可能设置不正确的开关。下面是我正在使用的代码的 sn-p 以及我返回的错误(或其中的一部分,很长)。我看到浏览器尝试打开然后立即关闭。

require "selenium-webdriver"
require "test/unit"

class PageLinks < Test::Unit::TestCase

  def setup
    @caps = Selenium::WebDriver::Remote::Capabilities.chrome
    @caps['chrome.switches'] = %w[--ignore-certificate-errors]
    @driver = Selenium::WebDriver.for( :remote, :url => 'http://localhost:4444/wd/hub', :desired_capabilities => @caps )
    @driver.manage.timeouts.implicit_wait = 200
    @driver.manage.timeouts.page_load = 200
    @wait = Selenium::WebDriver::Wait.new(:timeout => 200)
    @verification_errors = []
  end


  def teardown
    @driver.quit
  end


  def test_pagelinks
    @driver.get('http://www.yahoo.com')
    @driver.find_element(:link, "HOME").click

....

test_pagelinks(PageLinks):
Selenium::WebDriver::Error::UnknownError: [GET, HEAD, DELETE]
Command duration or timeout: 2 milliseconds
Build info: version: '2.20.0', revision: '16008', time: '2012-02-27 19:03:04'
System info: os.name: 'Windows 7', os.arch: 'x86', os.version: '6.1', java.version: '1.7.0_03'
Driver info: driver.version: RemoteWebDriver (org.openqa.selenium.UnsupportedCommandException)
[remote server] sun.reflect.NativeConstructorAccessorImpl():-2:in `newInstance0'
[remote server] sun.reflect.NativeConstructorAccessorImpl():-1:in `newInstance'

…………

【问题讨论】:

    标签: ruby google-chrome selenium webdriver


    【解决方案1】:

    page_load 超时设置是 Firefox 驱动程序中的一项实验性功能,Chrome 驱动程序尚不支持。

    【讨论】:

    • 天哪,谢谢!那真的让我头疼。我把那条线拿出来,一切都像魅力一样开始了。我可能会将此作为一个单独的问题提出,但我想知道您是否知道与 IE 类似的东西。此外,是否有一些包含这些秘密的大型文档,或者我是否只需要浏览各种变更日志和自述文件,直到我对此感到更舒服?抱歉,后续行动有些暗淡,但我们刚刚开始在我的办公室尝试硒,我们真的没有任何专家可以去问。再次感谢!
    猜你喜欢
    • 1970-01-01
    • 2021-05-16
    • 2018-06-08
    • 1970-01-01
    • 2017-01-01
    • 1970-01-01
    • 2023-01-07
    • 1970-01-01
    • 2021-06-10
    相关资源
    最近更新 更多