I would like to drag-and-drop one element to the position of another, triggered from within a watir-webdriver script.

By "drag-and-drop" I mean picking up a draggable element and releasing it on another. By "possible" I mean any method for drag/drop that can be executed from a watir-webdriver script. This includes code snippets, third party gems, etc.

As I understand it drag-and-drop is a feature request for core watir-webdriver (at time of asking), so I'm looking (in principle) for an alternative.

  • 2
    This Selenium TipsAndTricks page suggests it is possible to implement drag-and-drop on top of webdriver (Firefox but not IE): code.google.com/p/selenium/wiki/TipsAndTricks.
    – user246
    Jun 27, 2011 at 15:40
  • The best venue for technical questions regarding Watir or associated gems like watir-webdriver is the main StackOverflow site Jun 27, 2011 at 22:34
  • Yeah I do wish QA would migrate to SQA&T. Thanks for the advice, though, I shall do a crosspost of victory.
    – kinofrost
    Jun 28, 2011 at 8:19

2 Answers 2


This is how I'm doing drag and drop in watir-webdriver. This only works in Firefox:


  • Many thanks. Should be noted for other users that wd is part of the private API so shouldn't be used for large projects that cannot maintain a change to it. Luckily I'll use whatever I can get, and for non-IE testing this may prove very useful
    – kinofrost
    Jun 28, 2011 at 8:17
  • Still in today, it is working in firefox, but not in chrome! Is there a consistent fix for drag_and_drop_on/drag_and_drop_by in chrome? Oct 30, 2018 at 5:29

I've done something similar using events and/or autoit.. don't recall off the top of my head what the solution was (would need to go back and find that code)

I'd recommend asking on the main StackOverflow site and tag the question with Watir and Watir-webdriver.. a lot more of the Watir folks watch that site than this one

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.