Drag and Drop in Android.

649 views
Skip to first unread message

ritika mishra

unread,
Nov 7, 2013, 6:24:47 AM11/7/13
to appium-...@googlegroups.com
Hi,

Does Appium support dragging an element from one place and dropping it at another in android ? If it does can any one tell me how ?

Thanks,
Ritika

Jonathan Lipps

unread,
Nov 7, 2013, 5:39:28 PM11/7/13
to ritika mishra, appium-...@googlegroups.com
Yes. there's a test for this in our android testsuite.

--
http://appium.io
---
You received this message because you are subscribed to the Google Groups "Appium-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to appium-discus...@googlegroups.com.
Visit this group at http://groups.google.com/group/appium-discuss.
For more options, visit https://groups.google.com/groups/opt_out.

defonus

unread,
Nov 11, 2013, 7:43:58 AM11/11/13
to appium-...@googlegroups.com, ritika mishra
Hello. Your means test 'testSlider' from https://github.com/appium/appium/blob/master/sample-code/examples/java/testng/src/test/java/com/saucelabs/appium/UICatalogTest.java or something else?

Is it possible to create 'drag and drop' action on IOS application? (drag element (using long press), move to another position and release)?

пятница, 8 ноября 2013 г., 1:39:28 UTC+3 пользователь Jonathan Lipps написал:

Jonathan Lipps

unread,
Nov 11, 2013, 3:04:31 PM11/11/13
to defonus, appium-...@googlegroups.com, ritika mishra
You know it turns out there wasn't a test. So I added one.


I don't think dragAndDrop is implemented, and it doesn't seem possible given the vocabulary of apple's UIAutomation right now. (We have 'touch and hold' and 'drag from to for duration', but I don't think it's possible to chain them into one command).

defonus

unread,
Nov 12, 2013, 3:39:42 AM11/12/13
to appium-...@googlegroups.com, defonus, ritika mishra
Thank you. I can't find docs and examples for 'drag from to for duration'. I think it's my fail :( Can you provide java examples for this action?

I try use 'drag' with this code:

     JavascriptExecutor js = (JavascriptExecutor) driver;

       HashMap<String, Double> swipeObject = new HashMap<String, Double>();

       swipeObject.put("startX", 10.0);

       swipeObject.put("startY", 154.0);

       swipeObject.put("endX", 120.0);

       swipeObject.put("endY", 154.0);

       swipeObject.put("duration", 1.8);

       js.executeScript("mobile: drag", swipeObject);

but have - org.openqa.selenium.WebDriverException: Not yet implemented.




понедельник, 11 ноября 2013 г., 23:04:31 UTC+3 пользователь Jonathan Lipps написал:

defonus

unread,
Nov 12, 2013, 4:25:01 AM11/12/13
to appium-...@googlegroups.com, defonus, ritika mishra
Also I check

WebElement elem4drag = driver.findElement(By.xpath("/window[1]/scrollview[1]/button[2]"));

     JavascriptExecutor js = (JavascriptExecutor) driver;

     HashMap<String, String> swipeObject = new HashMap<String, String>();

     swipeObject.put("element", ((RemoteWebElement)elem4drag).getId());

     js.executeScript("mobile: longClick", swipeObject);


And have the same Exception :( 


вторник, 12 ноября 2013 г., 11:39:42 UTC+3 пользователь defonus написал:

Jonathan Lipps

unread,
Nov 12, 2013, 12:05:10 PM11/12/13
to defonus, appium-...@googlegroups.com, ritika mishra
It's mobile: swipe
Reply all
Reply to author
Forward
0 new messages