Auto Complete · Slider · Testing · watir · watir-webdriver

Automate JQuery Slider using Watir-WebDriver

Automate JQuery Slider using Watir-WebDriver:

Example Code:

require ‘rubygems’
require ‘watir-webdriver’

ie=Watir::Browser.new :ie
ie.goto(“http://jqueryui.com/demos/slider/”)
ie.link(:class,’ui-slider-handle ui-state-default ui-corner-all’).focus
ie.send_keys(:arrow_down)
ie.send_keys(:page_down)
ie.send_keys(:arrow_up)
ie.send_keys(:page_up)

 

Demo Output Video  —  http://bit.ly/j_slider

Advertisements

3 thoughts on “Automate JQuery Slider using Watir-WebDriver

  1. Nice trick. This should work as well:

    handle = ie.link(:class,”ui-slider-handle ui-state-default ui-corner-all”)
    handle.send_keys(:arrow_down, :page_down, :arrow_up, :page_up)

    or even:

    handle.drag_and_drop_by(50, 0)

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s