Advertisement
obernardovieira

Watir bowser automation test

Mar 7th, 2017
382
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Ruby 0.41 KB | None | 0 0
  1. require 'watir'
  2.  
  3. # Specify the driver path
  4. chromedriver_path = File.join(File.absolute_path("<complete-path-to-chromedriver>"))
  5. Selenium::WebDriver::Chrome.driver_path = chromedriver_path
  6.  
  7.  
  8. browser = Watir::Browser.new
  9. browser.goto 'google.com'
  10. browser.text_field(name: 'q').set 'Hello World!'
  11. browser.button(type: 'submit').click
  12.  
  13. puts browser.title
  14. # => 'Hello World! - Google Search'
  15. browser.close
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement