WebDriverAgent icon indicating copy to clipboard operation
WebDriverAgent copied to clipboard

pause Action Not Working in Pointer Action Sequence

Open myungkyojung opened this issue 1 year ago • 5 comments

I wrote a W3C action to perform a double-tap gesture, but I've encountered an issue where the action {"type":"pause", "duration": 200} doesn't seem to work as expected. The rest of the sequence executes correctly, but this specific pause doesn't have any effect. Could you help me understand why this is happening and how to fix it?

{ "actions":[ { "type":"pointer", "id":"finger1", "parameters":{"pointerType":"touch"}, "actions":[ {"type":"pointerMove", "x":100,"y":100}, {"type":"pointerDown"}, {"type":"pause", "duration": 50}, {"type":"pointerUp"}, {"type":"pause", "duration": 200}, {"type":"pointerDown"}, {"type":"pause", "duration": 50}, {"type":"pointerUp"} ] } ]

myungkyojung avatar Aug 28 '24 00:08 myungkyojung

https://github.com/appium/appium/issues/16583 could be duplicated. In sort, it might be difficult to fix with low-level XCTest APIs. https://appium.github.io/appium-xcuitest-driver/latest/guides/gestures/ also would help.

KazuCocoa avatar Aug 28 '24 01:08 KazuCocoa

Having the same problem, pause (no matter how long the duration is) seems to be ignored Used to work around this issue by using WDIO's touchAction method (https://webdriver.io/docs/api/browser/touchAction/) (I'm not sure how it's implemented internally), but now it's deprecated

For now it seems the only solution is to send 2 separate requests and pausing between them. But it's bad because there's no control over how long the requests will take, so precise actions are not possible with this workaround.

Gestures listed here https://appium.github.io/appium-xcuitest-driver/latest/guides/gestures/ do help too, but they're very limited compared to W3C Actions

danyatuna avatar Nov 11 '24 13:11 danyatuna

Adding another {"type":"pointerMove", "x":100,"y":100}, after the {"type":"pause", "duration": 200}, fix this kinda problem

Linloir avatar Nov 21 '24 05:11 Linloir

Sadly it didn't help, here's is the action I've tried - double tap with a 1.5 sec pause between taps:

await driver.performActions([
      {
        "type": "pointer",
        "id": "finger1",
        "parameters": {"pointerType": "touch"},
        "actions": [
          {"type": "pointerMove", "duration": 0, "x": coordinates.x, "y": coordinates.y},
          {"type": "pointerDown", "button": 0},
          {"type": "pause", "duration": 10},
          {"type": "pointerMove", "x": coordinates.x, "y": coordinates.y},
          {"type": "pointerUp", "button": 0},
          {"type": "pause", "duration": 1500},
          {"type": "pointerMove", "x": coordinates.x, "y": coordinates.y},
          {"type": "pointerDown", "button": 0},
          {"type": "pause", "duration": 10},
          {"type": "pointerMove", "x": coordinates.x, "y": coordinates.y},
          {"type": "pointerUp", "button": 0}
        ]
      }
    ]
)

The action is still clumped into something that looks like a single tap :(

danyatuna avatar Dec 03 '24 14:12 danyatuna

Try changing {"type": "pause", "duration": 10}, to {"type": "pointerMove", "duration": 10, "x": x, "y": y}

huan1936 avatar Mar 12 '25 09:03 huan1936