appium: Using iOS multitouch actions with double tap interprets commands with coordinates incorrectly
I 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.
About this issue
- Original URL
- State: closed
- Created 10 years ago
- Comments: 32 (12 by maintainers)
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:
Yes, subsequent values are being treated as offsets from the original.
What is in the server log for the first case?