How do I drag a jQuery slider handle from within Capybara and ChromeDriver?

前端 未结 2 1806
盖世英雄少女心
盖世英雄少女心 2021-01-11 23:32

I am able to execute the following code to move the slider handle, but the events triggered in the browser are not taking place.

page.execute_script(%Q($(\         


        
2条回答
  •  没有蜡笔的小新
    2021-01-11 23:59

    resynchronize has been removed from Capybara 2.0 so user853088's answer for Selenium would now look like this:

    module CapybaraSeleniumExtension
      def drag_by(right_by, down_by)
        driver.browser.action.drag_and_drop_by(native, right_by, down_by).perform
      end
    end
    

提交回复
热议问题