Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- require 'watir'
- # Specify the driver path
- chromedriver_path = File.join(File.absolute_path("<complete-path-to-chromedriver>"))
- Selenium::WebDriver::Chrome.driver_path = chromedriver_path
- browser = Watir::Browser.new
- browser.goto 'google.com'
- browser.text_field(name: 'q').set 'Hello World!'
- browser.button(type: 'submit').click
- puts browser.title
- # => 'Hello World! - Google Search'
- browser.close
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement