touchAction: longPress, moveTo, waitAction, release - doesn't work
See original GitHub issueDescription
I need to implement following gesture. Press on some element on the screen, move it to another element, waiting for 5 seconds and release it.
Trying to use below touchAction:
TouchAction touchAction = new TouchAction((AndroidDriver) driver); touchAction.longPress(FirstElement).moveTo(TwoElement.getCenter().x, TwoElement.getCenter().y).waitAction(Duration.ofMillis(15000)).release().perform();
But it doesn’t work. Nothing happens on the screen.
Environment
- java client build version: 5.0.0-BETA9
- Appium server: 1.7.1
- Desktop OS/version used to run Appium if necessary: macOS 10.13.3
- Mobile platform/version under test: Nexus 5X API 24, 7.0
- Real device or emulator/simulator: emulator
Details
If I use below touch action:
touchAction.longPress(FirstElement, Duration.ofMillis(15000)).moveTo(TwoElement.getCenter().x, TwoElement.getCenter().y).release().perform();
I see that required element is moving on the page, but it doesn’t wait before releasing.
Code To Reproduce Issue
TouchAction touchAction = new TouchAction((AndroidDriver) driver); touchAction.longPress(FirstElement).moveTo(TwoElement.getCenter().x, TwoElement.getCenter().y).waitAction(Duration.ofMillis(15000)).release().perform();
Link to Appium logs
https://gist.github.com/aozolin/86f7bba13f6951a5a0cf671a5c131485
Issue Analytics
- State:
- Created 6 years ago
- Comments:15 (6 by maintainers)
Top GitHub Comments
In case anyone else has a similar problem and can’t find a working solution, check out this post on SO.
@Garreth210 You are missing the waitAction.