- Appium 1.3.6
- Java-client 2.2.0
- Android : tried on Nexus 5
- Linux
Hello, I'm trying to perform a Drag & Drop but I need to scroll horizontally before dropping to the correct element (there are more elements than window width).
I saw there are wait methods() like waitAction() but it seems it doesn't work with moveTo(). I need to set the duration of the moveTo() gesture because the scroll is linked to the speed of the gesture.
Currently the moveTo() is instantaneous even used with waitAction(10000). So it prevents me to scroll like I want.
Here what I'm trying to do :
TouchAction a1 = new TouchAction(getDriver());
int swipeOffset = 10;
boolean elementIsNotDisplayed = true;
//waitAction ignored for moveTo, the gesture is instantaneous,
//it doesn't take 10sec to perform
a1.press(el_Drag).waitAction(2000).moveTo(1010, 1201).waitAction(10000).perform();
while (elementIsNotDisplayed) {
try {
MobileElement el = (MobileElement) driver.find(Drop element);
elementIsNotDisplayed = false;
} catch (NoSuchElementException e) {
a1.moveTo(1010 + swipeOffset, 1201).waitAction(10000).perform();
}
}
a1.moveTo(el_Drop).release().perform();
So basically I want to press on dragged element, moveTo specific location with a timed gesture, to perform my horizontalScrollView, and use other moveTo() to scroll to desired element if needed.
And then release the element at the correct location. Drag&Drop with scroll during it.
So please, what I am doing wrong? I just want to use moveTo() similarly to swipe(int duration).
From doc : "Appium performs the events in sequence. You can add a wait event to control
the timing of the gesture."