swipe ms == s
See original GitHub issue@toejough commented on Mon Nov 21 2016
Not sure where this belongs (here or the WDA project), but the swipe duration that used to be in ms is now in s.
Specifically, the command
[HTTP] --> POST /wd/hub/session/2f68760d-ccec-42e5-8836-8c3d72ce3393/touch/perform {"sessionId":"2f68760d-ccec-42e5-8836-8c3d72ce3393","actions":[{"options":{"x":187,"y":133},"action":"press"},{"options":{"ms":1000},"action":"wait"},{"options":{"x":0,"y":400},"action":"moveTo"},{"options":{},"action":"release"}]}
is always resulting in a long-press instead of a swipe action.
After searching around a bit, I found https://github.com/facebook/WebDriverAgent/issues/344, in which @marekcirkos says a user’s 800
is too long for duration, and the system might interpret it as a long-touch.
Sure enough, if I send 1
instead of 1000
in the “ms” field of the above request, it results in a 1s-long swipe.
The full log for that request has truncated lines - I’m not sure why, but here’s what they are:
[HTTP] --> POST /wd/hub/session/2f68760d-ccec-42e5-8836-8c3d72ce3393/touch/perform {"sessionId":"2f68760d-ccec-42e5-8836-8c3d72ce3393","actions":[{"options":{"x":187,"y":133},"action":"press"},{"options":{"ms":1000},"action":"wait"},{"options":{"x":0,"y":400},"action":"moveTo"},{"options":{},"action":"release"}]}
[MJSONWP] Calling AppiumDriver.performTouch() with args: [[{"options":{"x":187,"y":1...
[debug] [XCUITest] Executing command 'performTouch'
[JSONWP Proxy] Proxying [POST /uiaTarget/0/dragfromtoforduration] to [POST http://localhost:8100/session/3172B36F-75FC-449B-BA91-FB8B9FE12416/uiaTarget/0/dragfromtoforduration] with body: {"fromX":187,"fromY":133,"t...
[JSONWP Proxy] Got response with status 200: {"value":{},"sessionId":"31...
[MJSONWP] Responding to client with driver.performTouch() result: {}
[HTTP] <-- POST /wd/hub/session/2f68760d-ccec-42e5-8836-8c3d72ce3393/touch/perform 200 3272 ms - 74
@jlipps commented on Mon Nov 21 2016
@imurchie maybe WDA is using seconds instead of milliseconds, and we should convert?
@marekcirkos commented on Tue Nov 22 2016
@jlipps I would double check differences in Xcode. Apple might have change “mind” in new xcode and interpret them as seconds instead of milliseconds. In that case conversion should happen on WDA site.
Issue Analytics
- State:
- Created 7 years ago
- Comments:15 (6 by maintainers)
Top GitHub Comments
Closing this since the mystery is resolved; the current behavior is expected on the part of WDA, but that will hopefully change soon.
@asnaith but see what happens when Appium sends this data to WDA:
It converts it as expected into seconds for WDA. If it’s being interpreted as a long press rather than a drag, it seems like it’s a WDA issue instead.
…and confirmed. I just looked at the WDA source code, check out this section: https://github.com/facebook/WebDriverAgent/blob/eeaa1a3bbc9559d41ff3779c73c6678c7715a3d0/WebDriverAgentLib/Commands/FBElementCommands.m#L295-L306
It does indeed look like this does a press for the duration specified, and only then does the drag (for some unspecified amount of time?) @marekcirkos is this the intended behavior? press-for-duration-then-drag-for-unspecified-duration? Rather than simply drag-for-duration?