Guest User

Untitled

a guest
Dec 11th, 2018
68
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.28 KB | None | 0 0
  1. require 'selenium-webdriver'
  2.  
  3. browser = Selenium::WebDriver.for :firefox
  4. File.open("test.html", "w") { |file| file << "<h1>hello</h1>" }
  5.  
  6. begin
  7. browser.get "file://#{File.expand_path '../test.html', __FILE__}"
  8. puts browser.find_element(:tag_name => "h1").text
  9. ensure
  10. browser.quit
  11. end
Add Comment
Please, Sign In to add comment