Skip to content

Instantly share code, notes, and snippets.

@jarib
Created August 28, 2012 11:48
Show Gist options
  • Save jarib/3497468 to your computer and use it in GitHub Desktop.
Save jarib/3497468 to your computer and use it in GitHub Desktop.
require 'selenium-webdriver'
browser = Selenium::WebDriver.for :firefox
File.open("test.html", "w") { |file| file << "<h1>hello</h1>" }
begin
browser.get "file://#{File.expand_path '../test.html', __FILE__}"
puts browser.find_element(:tag_name => "h1").text
ensure
browser.quit
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment