question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

@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:closed
  • Created 7 years ago
  • Comments:15 (6 by maintainers)

github_iconTop GitHub Comments

2reactions
jlippscommented, Jan 25, 2017

Closing this since the mystery is resolved; the current behavior is expected on the part of WDA, but that will hopefully change soon.

1reaction
jlippscommented, Jan 24, 2017

@asnaith but see what happens when Appium sends this data to WDA:

2017-01-10 19:35:46:806 - info: [debug] [JSONWP Proxy] Proxying [POST /uiaTarget/0/dragfromtoforduration] to [POST http://localhost:8100/session/C4C63B99-65B7-4CEB-AB86-A830BD593DAA/uiaTarget/0/dragfromtoforduration] with body: {“fromX”:187,“fromY”:428,“toX”:374,“toY”:607,“duration”:3}

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?

Read more comments on GitHub >

github_iconTop Results From Across the Web

swipe ms == s · Issue #306 · appium/appium-xcuitest-driver
After searching around a bit, I found facebookarchive/WebDriverAgent#344, in which @marekcirkos says a user's 800 is too long for duration, and ...
Read more >
'Swipe actions' in Google Messages app is now more ...
Google is addressing it by offering users more customizations to give them more control over swipes. The new 'Swipe actions' page now gives...
Read more >
How do I customize my swipe options? - Microsoft Support
Open Outlook Mobile Settings. Select Swipe Options. Select Swipe Right or Swipe Left. Assign one of the follow preferred actions: Delete, Mark as...
Read more >
Swipe - Apps on Google Play
Forget needing to use multiple dating apps. The Swipe app is the dating app you need today. Singles are connecting and meeting through...
Read more >
react-swipeable - npm
React Swipe event handler hook. ... set a rotation angle swipeDuration: Infinity, // allowable duration of a swipe (ms).
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found