I have a set of 10 JQuery UI sliders that need to be tested in some fashion.
Specifically, I need to drag each slider handle and observe the current value of the slider.
I've tried using various methods on the Selenium driver to grab it, like:
handle = find(".ui-slider-handle")
find("#category_weight_#{cw.id}").native.drag_and_drop_by(handle,'10px')
But I keep getting deprecation errors, and can't find decent开发者_开发知识库 examples of using the new action builder in selenium.
Anyone doing this, have any advice?
try this code for sliding:
page.execute_script "s=$('#slider');"
page.execute_script "s.slider('option', 'value', #{value})"
page.execute_script "s.slider('option','slide').call(s,null,{ handle: $('.ui-slider-handle', s), value: #{value} });"
This worked fine for Capybara/Selenium tests.
I tested noui slider for RoR application with Cucumber/Capybara
精彩评论