I am trying to work on some tests for an iPad app to verify the keyboard shortcuts that activate some tools (without starting or being able to start the native keyboard of the iPad).
Does anyone know if this is possible and if so, can you share how?
I need to press CMD + Z, I’m using: self.driver.execute_script(“mobile: keys”, {“keys”: [{“key”: “z”, “modifierFlags”: “1 << 4”}]})
and it activates the tool corresponding to Z, instead of CMD + Z.
Logs:
[XCUITestDriver@6072 (e9b3a076)] Calling AppiumDriver.execute() with args: [“mobile: keys”,[{“keys”:[{“key”:“z”,“modifierFlags”:“1 << 4”}]}],“e9b3a076-3ffd-43e8-85e2-5b2bf8ef3c24”]
[XCUITestDriver@6072 (e9b3a076)] Executing command ‘execute’
[XCUITestDriver@6072 (e9b3a076)] Proxying to WDA with an unknown route: POST /wda/element/0/keyboardInput
[XCUITestDriver@6072 (e9b3a076)] Proxying [POST /wda/element/0/keyboardInput] to [POST http://127.0.0.1:8100/session/FA5A0468-65DE-4795-9D3F-78F6CF9AEB7A/wda/element/0/keyboardInput] with body: {“keys”:[{“key”:“z”,“modifierFlags”:“1 << 4”}]}
[XCUITestDriver@6072 (e9b3a076)] Got response with status 200: {“value”:null,“sessionId”:“FA5A0468-65DE-4795-9D3F-78F6CF9AEB7A”}
[XCUITestDriver@6072 (e9b3a076)] Responding to client with driver.execute() result: null