Drag the object with a pause before falling

I use watir for automatic testing, in fact, this project is a task manager.

tasks fall on the day of the week, but it takes some time to complete the task so that the task hangs over that particular day so that it is recognized by javascript.

At the moment, this is only a problem with firefox, chrome is fine.

So my question is: can you drag, but hold the item over the area in front of the frame?

currently using this function:

dragTask.drag_and_drop_on dropTask 
+4
source share
1 answer

There was the same question a while ago with Watir-WebDriver and initially came up with the monkey fix for Selenium ActionBuilder. It was like this:

 require 'watir-webdriver' module Selenium module WebDriver class ActionBuilder def hold(timeout) @devices.merge!(:self => self) unless @devices[:self] @actions << [:self, :sleep, timeout] self end end # ActionBuilder end # WebDriver end # Selenium begin browser = Watir::Browser.new browser.goto "data:text/html,#{DATA.read}" button_1 = browser.button(id: "button1") button_2 = browser.button(id: "button2") browser.driver.action. click_and_hold(button_1.wd). move_to(button_2.wd). hold(3). release. perform ensure browser.close end __END__ <html> <button id="button1">Button 1</button> <button id="button2">Button 2</button> </html> 
+3
source

All Articles