Skip to content

Instantly share code, notes, and snippets.

@dmitrym0
Created April 21, 2014 19:52
Show Gist options
  • Save dmitrym0/11154340 to your computer and use it in GitHub Desktop.
Save dmitrym0/11154340 to your computer and use it in GitHub Desktop.
Moving cursor around with watir-webdriver and Selenium Actionbuilder.
require 'watir-webdriver'
browser = Watir::Browser.new :chrome
browser.goto 'http://html5demos.com/canvas-grad'
element = browser.driver.find_element(:tag_name, 'canvas')
browser.driver.action.move_to(element, 10, 10).perform
sleep 1
browser.driver.action.move_to(element, 100, 100).perform
sleep 1
browser.driver.action.move_to(element, 500, 500).perform
sleep 1
browser.driver.action.move_to(element, 1000, 1000).perform
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment