Reputation: 127
I am running below script for Chrome but its showing me error while running script
require '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'
Getting below error for running script
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)
Upvotes: 3
Views: 4163
Reputation: 37826
You have to install/configure ChromeDriver. The following are the steps:
Upvotes: 1
Reputation: 57312
Well, the error message says it all. You have to install chromedriver:
https://github.com/watir/watirbook/blob/master/manuscript/installation/windows.md#chrome
Upvotes: 5
Reputation: 39763
On Mac, I found that not all PATH directories worked. Pasting the file in this path (folder), however, did work for me (make sure its called 'chromedriver', not 'chromedriver2'! (happened b/c of duplicate download)
/Users/[mac_account_name]/.rvm/gems/ruby-1.9.3-p286/bin/
Obviously, I use rvm.
(be sure to restart the shell after you add it to pick up the changes)
Upvotes: 0