Skip to content

Instantly share code, notes, and snippets.

@ivaravko
Forked from jarib/gist:1782269
Created May 23, 2012 20:15
Show Gist options
  • Save ivaravko/2777499 to your computer and use it in GitHub Desktop.
Save ivaravko/2777499 to your computer and use it in GitHub Desktop.
require 'selenium/webdriver'
driver = Selenium::WebDriver.for :firefox
driver.get "http://jqueryui.com/demos/slider/range.html"
amount = driver.find_element(:id => "amount")
left, right = driver.find_elements(:class => "ui-slider-handle")
driver.action.click_and_hold(left).perform
until amount[:value].include? "150"
p :amount => amount[:value]
driver.action.move_by(5, 0).perform
end
driver.action.release
driver.action.click_and_hold(right).perform
until amount[:value].include? "280"
p :amount => amount[:value]
driver.action.move_by(-5, 0).perform
end
driver.action.release
p amount[:value]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment