I ran into a similar thing recently, haven't had time to circle back and see 
why, may have been user error. It wasn't working in using the native watir 
method but I did get things to work by using the webdriver ActionBuilder. At 
that point I dropped it (so to speak) because drag and drop wasn't necessary 
for what I was doing. And I didn't dig into the Ruby code to see what, if any 
difference there was. But it may be worth trying it this way (you can break it 
down further if you need to but action.drag_and_drop was enough for me). 

http://selenium.googlecode.com/svn@7079/trunk/docs/api/rb/Selenium/WebDriver/ActionBuilder.html


el1 = driver.find_element(:id, "some_id1") el2 = driver.find_element(:id, 
"some_id2") driver.action.drag_and_drop(el1, el2).perform




________________________________
 From: watir webdriver <[email protected]>
To: [email protected] 
Sent: Wednesday, July 3, 2013 6:53 AM
Subject: [wtr-general] [Watir-webdriver] - Drag and drop using watir webdriver
 


Hi there,

I'm trying to drag and drop an element in webpage through the below code:

Step def:
When(/^I drag and drop Basket rule to the position slot$/) do
@browser.span(:class => "draggable 
ui-draggable").drag_and_drop_on(@browser.div(:class => "droparea ui-droppable 
ui-sortable"))
end

The scenario is passing but on the webpage its just high lighting the draggable 
element.(drop is not working)

HTML code for draggable code:
<tr>
<td>
<span class="draggable ui-draggable" full="Basket" aid="BASKET">Basket</span>
</td>
<tr>


HTML code for droppable code:
<div id="0" class="droparea ui-droppable ui-sortable">

Anyone can help me with this issue ?

Thanks in-advance.


-- 
-- 
Before posting, please read http://watir.com/support. In short: search before 
you ask, be nice.
 
[email protected]
http://groups.google.com/group/watir-general
[email protected]
 
--- 
You received this message because you are subscribed to the Google Groups 
"Watir General" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/groups/opt_out.

-- 
-- 
Before posting, please read http://watir.com/support. In short: search before 
you ask, be nice.

[email protected]
http://groups.google.com/group/watir-general
[email protected]

--- 
You received this message because you are subscribed to the Google Groups 
"Watir General" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/groups/opt_out.


Reply via email to