I am using Appium Python to send double-tap (also known as double-click). I tried the following 3 codes. They sometimes work but sometimes not.
action = TouchAction(driver)
action.tap(x=x, y=y).wait(10).tap(x=x, y=y).perform() # 1
action.tap(x=x, y=y).tap(x=x, y=y).perform() # 2
action.tap(x=x, y=y, count=2).perform() # 3
I looked into Appium server log.
When they didn't work, the two taps had too much time in between, even if I set 0 wait between the 2 taps. Below I saw 0.9 second between 2 taps.
2023-01-01 00:45:15:379 [W3C (0e33c728)] Calling AppiumDriver.performTouch() with args: [[{"action":"tap","options":{"x":551.5,"y":1107,"count":1}},{"action":"tap","options":{"x":551.5,"y":1107,"count":1}}],"0e33c728-8dc6-49b5-82dd-567c1508a410"]
2023-01-01 00:45:15:382 [WD Proxy] Proxying [POST /appium/tap] to [POST http://127.0.0.1:8200/wd/hub/session/448df8e5-309e-4448-bf69-dbfd36602b77/appium/tap] with body: {"x":551.5,"y":1107,"undefined":null}
2023-01-01 00:45:16:256 [WD Proxy] Got response with status 200: {"sessionId":"448df8e5-309e-4448-bf69-dbfd36602b77","value":null}
2023-01-01 00:45:16:259 [WD Proxy] Proxying [POST /appium/tap] to [POST http://127.0.0.1:8200/wd/hub/session/448df8e5-309e-4448-bf69-dbfd36602b77/appium/tap] with body: {"x":551.5,"y":1107,"undefined":null}
2023-01-01 00:45:16:931 [WD Proxy] Got response with status 200: {"sessionId":"448df8e5-309e-4448-bf69-dbfd36602b77","value":null}
When they worked, I saw the interval was 0.28 second.
Part of the delay was from my computer. I am using Android Wireless Debugging. I cannot do much about this.
There are at least 2 other things that I'd like to explore:
- is there a way to extend Android device's double-tap timer? To allow 0.9 second between two taps.
- is there a way that Appium TouchAction can send the 2nd action without waiting for the response from the 1st action?
I welcome other suggestions.
Thank you