Using iOS multitouch actions with double tap interprets commands with coordinates incorrectly
See original GitHub issueI tried doing a double tap with the multi actions but i get no response.
Initially I tried to do a
new TouchAction(driver)
.Tap(point.X, point.Y, count: 2)
.Perform()
I wasn’t sure if it was tapping it too fast or too slow, since the outcome wasn’t doing anything. I changed the test code to the following:
new TouchAction(driver)
.Press(point.X, point.Y)
.Wait(200)
.Release()
.Wait(500)
.Press(point.X, point.Y)
.Wait(200)
.Release()
.Wait(500)
.Perform();
The x coordinates is 160, and the y is 284.
However in the log it shows:
debug: Appium request initiated at /wd/hub/session/55c88d68-ea9a-4ce9-b078-87d7b909c107/touch/perform
debug: Request received with params: {"actions":[{"action":"press","options":{"x":160,"y":284}},{"action":"wait","options":{"ms":200}},{"action":"release"},{"action":"wait","options":{"ms":500}},{"action":"press","options":{"x":160,"y":284}},{"action":"wait","options":{"ms":200}},{"action":"release"},{"action":"wait","options":{"ms":500}}]}
debug: Pushing command to appium work queue: "target.touch([{\"touch\":[{\"x\":160,\"y\":284}],\"time\":0.2},{\"touch\":[{\"x\":160,\"y\":284}],\"time\":0.4},{\"touch\":[{\"x\":160,\"y\":284}],\"time\":0.6000000000000001},{\"touch\":[{\"x\":160,\"y\":284}],\"time\":1.1},{\"touch\":[{\"x\":320,\"y\":568}],\"time\":1.3},{\"touch\":[{\"x\":320,\"y\":568}],\"time\":1.5},{\"touch\":[{\"x\":320,\"y\":568}],\"time\":1.7},{\"touch\":[{\"x\":320,\"y\":568}],\"time\":2.2}])"
debug: Sending command to instruments: target.touch([{"touch":[{"x":160,"y":284}],"time":0.2},{"touch":[{"x":160,"y":284}],"time":0.4},{"touch":[{"x":160,"y":284}],"time":0.6000000000000001},{"touch":[{"x":160,"y":284}],"time":1.1},{"touch":[{"x":320,"y":568}],"time":1.3},{"touch":[{"x":320,"y":568}],"time":1.5},{"touch":[{"x":320,"y":568}],"time":1.7},{"touch":[{"x":320,"y":568}],"time":2.2}])
debug: Sending command to instruments: target.touch([{"touch":[{"x":160,"y":284}],"time":0.2},{"touch":[{"x":160,"y":284}],"time":0.4},{"touch":[{"x":160,"y":284}],"time":0.6000000000000001},{"touch":[{"x":160,"y":284}],"time":1.1},{"touch":[{"x":320,"y":568}],"time":1.3},{"touch":[{"x":320,"y":568}],"time":1.5},{"touch":[{"x":320,"y":568}],"time":1.7},{"touch":[{"x":320,"y":568}],"time":2.2}])
info: --> POST /wd/hub/session/55c88d68-ea9a-4ce9-b078-87d7b909c107/touch/perform {"actions":[{"action":"press","options":{"x":160,"y":284}},{"action":"wait","options":{"ms":200}},{"action":"release"},{"action":"wait","options":{"ms":500}},{"action":"press","options":{"x":160,"y":284}},{"action":"wait","options":{"ms":200}},{"action":"release"},{"action":"wait","options":{"ms":500}}]}
debug: [INST] 2014-08-18 23:55:38 +0000 Debug: Got new command 71 from instruments: target.touch([{"touch":[{"x":160,"y":284}],"time":0.2},{"touch":[{"x":160,"y":284}],"time":0.4},{"touch":[{"x":160,"y":284}],"time":0.6000000000000001},{"touch":[{"x":160,"y":284}],"time":1.1},{"touch":[{"x":320,"y":568}],"time":1.3},{"touch":[{"x":320,"y":568}],"time":1.5},{"touch":[{"x":320,"y":568}],"time":1.7},{"touch":[{"x":320,"y":568}],"time":2.2}])
debug: [INST] 2014-08-18 23:55:38 +0000 Debug: evaluating target.touch([{"touch":[{"x":160,"y":284}],"time":0.2},{"touch":[{"x":160,"y":284}],"time":0.4},{"touch":[{"x":160,"y":284}],"time":0.6000000000000001},{"touch":[{"x":160,"y":284}],"time":1.1},{"touch":[{"x":320,"y":568}],"time":1.3},{"touch":[{"x":320,"y":568}],"time":1.5},{"touch":[{"x":320,"y":568}],"time":1.7},{"touch":[{"x":320,"y":568}],"time":2.2}])
debug: [INST] 2014-08-18 23:55:38 +0000 Debug: target.touch(__NSCFArray)
debug: [INST] 2014-08-18 23:55:40 +0000 Debug: evaluation finished
In the log you can see {“touch”:[{“x”:320,“y”:568} which looks suspicious. where x = 320 = 160 x 2 and Y is 284 x 2.
In both cases, double tap does not work as intended.
Issue Analytics
- State:
- Created 9 years ago
- Comments:32 (12 by maintainers)
Top Results From Across the Web
Use Touch Accommodations with your iPhone, iPad, iPod ...
Touch Accommodations changes how the screen on your device responds to taps, swipes, and other gestures.
Read more >Touch Perform
'Touch Perform' works similarly to the other singular touch interactions, except that this allows you to chain together more than one touch action...
Read more >9 Audio-Based Feedback Techniques for Teaching ...
tasks for single-stroke, multistroke, and multitouch gestures using the ... and multifinger tap, double tap, tap and hold, and directional drag and swipes....
Read more >Designing for Touch
This is an sample chapter from Josh Clark's book Designing for Touch. 2015, A Book Apart. Chapter 4: Gestures. Cover: Designing for Touch...
Read more >Using Touch Events - Web APIs | MDN
A multi-touch interaction starts when a finger (or stylus) first touches the contact surface. Other fingers may subsequently touch the surface ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
I just tried this in Java, and it worked for me. Please try it out and update your result:
NOTE: the second press is on x-coord = 0, and y-coord = 0, based on the comment by “imurchie” above.
Yes, since the second is an offset from the first, if you offset 0, 0, it is the same point.
For the second, I’m not sure what the issue is. Instruments often doesn’t return anything, which makes Appium print that message.
On Wed, Aug 20, 2014 at 3:26 PM, glorylo notifications@github.com wrote: