-
-
Save mattwynne/3498129 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File.open("test.html", "w") { |file| file << "<h1>hello</h1>" } | |
url = "file://#{File.expand_path '../test.html', __FILE__}" | |
require 'capybara' | |
browser = Capybara::Session.new(:selenium) | |
browser.visit url | |
puts browser.find("h1").text |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File.open("test.html", "w") { |file| file << "<h1>hello</h1>" } | |
url = "file://#{File.expand_path '../test.html', __FILE__}" | |
require 'selenium-webdriver' | |
browser = Selenium::WebDriver.for :firefox | |
begin | |
browser.get url | |
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
The test-capybara script fails with Capybara 1.1.2 (on my machine at least) but it does pass on Capybara 2.0.0 beta2.