1zpu_w
Last Updated: February 25, 2016
·
620
· gouravtiwari
Febcde7f09d486161ab6b3180c8b85c7

Drag and drop feature WatirWebdriver

browser = Watir::Browser.new :firefox

elementToPick = browser.div(:id => 'elementToPickId')
elementToCollect = browser.a(:id => 'elementToCollectId')

elementToPick.fire_event("onmousedown")
driver=browser.driver
driver.action.click_and_hold(elementToPick.wd).perform
sleep 2
driver.action.move_to(elementToCollect.wd).perform
sleep 2
elementToCollect.fire_event("onmouseup")
Say Thanks
Respond