Skip to content

Instantly share code, notes, and snippets.

@dmitrym0
Created March 1, 2016 04:13
Show Gist options
  • Save dmitrym0/c7150e0af3f50183f078 to your computer and use it in GitHub Desktop.
Save dmitrym0/c7150e0af3f50183f078 to your computer and use it in GitHub Desktop.
scribbles with watir
require 'watir-webdriver'
browser = Watir::Browser.new :chrome
browser.goto 'http://intridea.github.io/sketch.js/'
sleep 3
element = browser.driver.find_element(:tag_name, 'canvas')
browser.driver.action.move_to(element, 10, 10).click_and_hold.perform
sleep 1
browser.driver.action.move_to(element, 100, 100).perform
sleep 1
browser.driver.action.move_to(element, 110, 50).perform
sleep 1
browser.driver.action.move_to(element, 130, 100).perform
sleep 1
browser.driver.action.move_to(element, 150, 200).perform
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment