Skip to content

Instantly share code, notes, and snippets.

@jarib
Forked from vdabravolski/ie_issue.html
Created August 30, 2011 20:39
Show Gist options
  • Save jarib/1181958 to your computer and use it in GitHub Desktop.
Save jarib/1181958 to your computer and use it in GitHub Desktop.
IE issue of watir-webdriver
require "selenium-webdriver"
d = Selenium::WebDriver.for :ie
d.get("data:text/html;charset=utf-8,#{URI.encode DATA.read}")
d.find_element(:xpath => "//input[@value='Test Button']").click
d.find_element(:link_text, "Test Link").click
p d.find_element(:id => "log").text
__END__
<html>
<head>
<script>
function log(msg) { document.getElementById('log').innerHTML += msg; };
</script>
</head>
<body>
<input onclick="log('Button with Event was clicked');" type="button" value="Test Button"/>
<br>
<br>
<a href="" onclick="log('Link with Event was clicked');"> Test Link</a>
<p id="log"></p>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment