Pad*_*y M 2 ruby google-chrome watir firewatir watir-webdriver
我在Chrome下运行脚本,但在运行脚本时显示错误
要求'watir-webdriver'
b = Watir::Browser.new:chrome
b.goto 'bit.ly/watir-webdriver-demo'
b.text_field(:id => 'entry_0').set 'your name'
b.select_list(:id => 'entry_1').select 'Ruby'
b.select_list(:id => 'entry_1').selected? 'Ruby'
b.button(:name => 'submit').click
b.text.include? 'Thank you'
Run Code Online (Sandbox Code Playgroud)
运行脚本时出现以下错误
C:/Ruby193/lib/ruby/gems/1.9.1/gems/selenium-webdriver-2.21.2/lib/selenium/webdr
iver/chrome/service.rb:19:in `executable_path': Unable to find the chromedriver
executable. Please download the server from http://code.google.com/p/chromedrive
r/downloads/list and place it somewhere on your PATH. More info at http://code.g
oogle.com/p/selenium/wiki/ChromeDriver. (Selenium::WebDriver::Error::WebDriverEr
ror)
Run Code Online (Sandbox Code Playgroud)
好吧,错误信息说明了一切.你必须安装chromedriver:
https://github.com/watir/watirbook/blob/master/manuscript/installation/windows.md#chrome
| 归档时间: |
|
| 查看次数: |
3935 次 |
| 最近记录: |