Skip to content

Instantly share code, notes, and snippets.

@jarib
Created December 8, 2011 00:04
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jarib/1445418 to your computer and use it in GitHub Desktop.
Save jarib/1445418 to your computer and use it in GitHub Desktop.
require 'watir-webdriver'
class Watir::Element
def hover
assert_exists
driver.action.move_to(@element).perform
end
end
profile = Selenium::WebDriver::Firefox::Profile.new
profile.native_events = true
browser = Watir::Browser.new :firefox, :profile => profile
browser.goto "https://www.servage.net/blog/wp-content/uploads/2009/03/css-menu.html"
browser.a(:text => "About").hover
browser.a(:text => "The Team").when_present.click
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment