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")
Written by Gourav Tiwari
Related protips
Have a fresh tip? Share with Coderwall community!
Post
Post a tip
Best
#Ruby
Authors
Sponsored by #native_company# — Learn More
#native_title#
#native_desc#