Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>it's a Jquery widget that appears (looking at the scripts) to respond to key presses once one of the handles has been clicked on. the handles are link objects, inside a pair of divs, the outer one has the ID value 'slider-range'</p> <p>You should be able to address them via <code>browser.div(:id =&gt; 'slider-range').link(:index =&gt; n)</code> where n = 0 for the lefthand one and n=1 for the right hand one. </p> <p>Try this manually first</p> <ul> <li>Click on the left handle for the slider </li> <li>Then press arrow keys on the keyboard.. it will move 1K(pounds) up or down with each right or left arrow keypress. </li> <li>Once you have moved it right, click the Home key and it should reset to its min value </li> <li>repeat above for the right handle but reset it to far right using the End key.</li> </ul> <p>In theory you could fire a click event at the right slider to get focus, then fire off some keypress events to first set it far right (end) followed by enough left arrows to move it down to the top value you want.</p> <p>Repeat for the left handle, setting it to the left end with the home key, and moving it with right arrow keypresses</p> <p>I don't have the time right now to experiment further and develop an exact script, but I think you could probably create two little functions even that took an upper and lower range value and did the required number of keypresses to move the lower up from 5K to the right amount, and the upper down from 100k </p> <p>Note that this thing is very very event driven, it responds (at least when watching the dev tools while playing with it) to being moused over, mousedown, mouseup, etc.. if using click does not work to 'get the attention' of the control so it will respond to keypresses, try using the onmousedown event instead.</p> <p>Using the code from your answer, to move the left slider to 12K I'd try</p> <pre><code>browser.div(:id =&gt; 'slider-range').link(:index =&gt; 0).click #make sure it has focus browser.div(:id =&gt; 'slider-range').link(:index =&gt; 0).send_keys :home #set to 5K 7.times do browser.div(:id =&gt; 'slider-range').link(:index =&gt; 0).send_keys :arrow_right end </code></pre>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload