Skip to content

Instantly share code, notes, and snippets.

@jarib
Created August 1, 2011 12:50
Show Gist options
  • Save jarib/1118060 to your computer and use it in GitHub Desktop.
Save jarib/1118060 to your computer and use it in GitHub Desktop.
{:x=>"", :y=>""}
{:x=>"100", :y=>"2279"}
{:x=>"200", :y=>"2379"}
{:x=>"300", :y=>"2479"}
require "watir-webdriver"
require "selenium-webdriver"
include Watir
browser = Browser.new :chrome
driver = browser.driver
driver.navigate.to "http://javascript.ru/ui/draganddrop#demo"
p :x => browser.element(:id => "mouseX").value,
:y => browser.element(:id => "mouseY").value
driver.action.move_by(100,100).perform
p :x => browser.element(:id => "mouseX").value,
:y => browser.element(:id => "mouseY").value
driver.action.move_by(100,100).perform
p :x => browser.element(:id => "mouseX").value,
:y => browser.element(:id => "mouseY").value
driver.action.move_by(100,100).perform
p :x => browser.element(:id => "mouseX").value,
:y => browser.element(:id => "mouseY").value
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment