Created
April 9, 2013 13:47
-
-
Save jarib/5345800 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
require 'selenium-webdriver' | |
driver = Selenium::WebDriver.for :firefox | |
frame_html = <<-HTML | |
<a id="submit" href="#" onclick="window.top.location = 'http://www.google.no/'; return false;">Continue</a> | |
HTML | |
page = <<-HTML | |
<!DOCTYPE html> | |
<html> | |
<head> | |
<meta charset="utf-8"> | |
<title>Page Title</title> | |
</head> | |
<body> | |
<iframe id="search" src="data:text/html;content-type=utf-8,#{URI.escape frame_html}"></iframe> | |
</body> | |
</html> | |
HTML | |
driver.get "data:text/html;content-type=utf-8,#{URI.escape page}" | |
driver.switch_to.frame(0) | |
driver.find_element(id: 'submit').click | |
puts "ok" | |
driver.quit |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment