Take the 2-minute tour ×
Software Quality Assurance & Testing Stack Exchange is a question and answer site for software quality control experts, automation engineers, and software testers. It's 100% free, no registration required.

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.

share|improve this question
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 '11 at 15:40
    
The best venue for technical questions regarding Watir or associated gems like watir-webdriver is the main StackOverflow site –  Chuck van der Linden Jun 27 '11 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 '11 at 8:19

2 Answers 2

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

browser.div(:text=>"from_div").wd.drag_and_drop_on(browser.div(:text=>"to_div").wd)

share|improve this answer
    
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 '11 at 8:17

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

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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