Created
June 17, 2011 15:02
-
-
Save jarib/1031588 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'selenium-webdriver' | |
driver = Selenium::WebDriver.for :chrome | |
driver.extend Selenium::WebDriver::DriverExtensions::HasInputDevices | |
wait = Selenium::WebDriver::Wait.new | |
begin | |
driver.get "http://dev.sencha.com/deploy/touch/examples/kitchensink/" | |
wait.until { driver.all(:class => "x-list-item-body").find { |e| e.displayed? && e.text == "User Interface"} }.click | |
wait.until { driver.all(:class => "x-list-item-body").find { |e| e.displayed? && e.text == "List"} }.click | |
top = driver.all(:class => "x-list-item").find { |e| e.text == "Allan Disbrow"} | |
bot = driver.all(:class => "x-list-item").find { |e| e.text == "Darren Devalle"} | |
p :top => top.location, :bot => bot.location | |
driver.action.click_and_hold(top).move_by(0, -100).release.perform | |
p :top => top.location, :bot => bot.location | |
sleep 5 | |
ensure | |
driver.quit | |
end | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment