How to automate range values using web driver?
I have to test a price range bar implemented with a jQuery slider. Suppose the defined range is 100-10,000. I want web driver to slide the minimum value to 2000 and Maximum value to 8000. I thought of using dragAndDrop property but got stuck in the situation to give target value. I am in a situation where I don't have id's for both the div.
What to do?
The actual slider is a link-element you should be able to define a css selector based on its classes.
<a class="ui-slider-handle ui-state-default ui-corner-all" href="//#"></a>
The first you find is the left slider, the second the right slider.
I have successfully used use the Action Builder and the MoveToOffsetAction to drag a slider X number of pixels into a direction. I would only do this if you need to verify an event fired during the sliding.
I think its a jQuery best practise to put the slider component in to a div with an id. If your slider does not have an id, urge the developers to give it one. Note the draggers have no id and can only be found in the slider compontent div on its class.