Hi,
I am using below code the perform vertical swipe on the screen, but the swipe action is not performing:
Dimension size = driver.manage().window().getSize();
int endPoint = (int) (size.height * 0.80);
int startPoint = (int) (size.height * 0.40);
int anchor = size.width/3;
new TouchAction(driver).press(anchor, startPoint).waitAction(Duration.ofSeconds(1)).moveTo(anchor, endPoint).release().perform();
Environment:
iOS: 10.3
XCode: 9.1
Appium version: 1.7.1 & 1.7.2
But when see in the appium log, I am seeing my coordinates are doubled when calling WDA dragfromtoforduration method. Below is the appium log:
[HTTP] --> POST /wd/hub/session/3a35959c-ee80-401b-96a9-f7c455576dfe/touch/perform {“actions”:[{“action”:“press”,“options”:{“x”:125,“y”:266}},{“action”:“wait”,“options”:{“ms”:0}},{“action”:“moveTo”,“options”:{“x”:125,“y”:533}},{“action”:“release”,“options”:{}}]}
[MJSONWP] Calling AppiumDriver.performTouch() with args: [[{“action”:“press”,“options”:{“x”:125,“y”:266}},{“action”:“wait”,“options”:{“ms”:0}},{“action”:“moveTo”,“options”:{“x”:125,“y”:533}},{“action”:“release”,“options”:{}}],“3a35959c-ee80-401b-96a9-f7c455576dfe”]
[XCUITest] Executing command ‘performTouch’
[XCUITest] Received the following touch action: press(options={“x”:125,“y”:266})-wait(options={“ms”:0})-moveTo(options={“x”:125,“y”:533})-release(options={})
[XCUITest] Found matching gesture: drag
[JSONWP Proxy] Proxying [POST /wda/dragfromtoforduration] to [POST http://localhost:8100/session/4235AB4E-6FC0-4CD8-8C46-A9855753CE0E/wda/dragfromtoforduration] with body: {“fromX”:125,“fromY”:266,“toX”:250,“toY”:799,“duration”:0}
[JSONWP Proxy] Got response with status 200: {“value”:{},“sessionId”:“4235AB4E-6FC0-4CD8-8C46-A9855753CE0E”,“status”:0}
[MJSONWP] Responding to client with driver.performTouch() result: null
[HTTP] <-- POST /wd/hub/session/3a35959c-ee80-401b-96a9-f7c455576dfe/touch/perform 200 1403 ms - 76