How to test the jQuery UI slider widget with Selenium IDE?

后端 未结 4 1573
忘了有多久
忘了有多久 2021-02-15 21:08

We are using the jQuery UI slider widget in our web application and we want to automate testing of the UI with selenium IDE. We can\'t find a way to move the slider with seleniu

相关标签:
4条回答
  • 2021-02-15 21:25

    You can use the dragAndDrop command to move the slider. The following worked for me:

    dragAndDrop | css=.ui-slider-handle | +100,0
    

    This moves the slider 100 pixels to the right of its current position.

    0 讨论(0)
  • 2021-02-15 21:43

    Just in case anyone else has this problem and needs another perspective...

    I had this problem a while ago and solved it by having the slider populate a hidden field and I used that as my interface with selenium IDE. I wasn't required to verify the slider worked at all so there was no need to test it. I just wanted the value of the slider.

    0 讨论(0)
  • 2021-02-15 21:49

    If you have several sliders, the command to move one of them is css=#id .ui-slider-handle

    Thanks to Dave for the answer!

    0 讨论(0)
  • 2021-02-15 21:52

    there is only one (horrible) solution for this. You will have to interact with the slider thought its jquery api.

    selenium has a runScript method where you can pass some javascript to run. Do this only as your last resort though, as this will lead you down a slippery slope

    0 讨论(0)
提交回复
热议问题