简体   繁体   中英

Selenium Ruby Webdriver unable to run Chrome browser

I am attempting to start a remote session for chrome and keep getting the same issue. The script isn't that complicated. I am wondering if it isn't some switch that might be set incorrectly. Below is a snippet of code I am using along with the error I am getting back (or part of it, very long). I see the browser attempt to open and then immediately close.

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'

.........

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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM