microsoft / WinAppDriver

Windows Application Driver
MIT License
3.66k stars 1.4k forks source link

Will key input events ever be supported? #1956

Open DiegoSalazar opened 10 months ago

DiegoSalazar commented 10 months ago

I'm trying to use WinAppDriver to login to an app. But apparently sendKeys is not supported? The docs says it is: https://github.com/microsoft/WinAppDriver/blob/master/Docs/SupportedAPIs.md

The above says it supports the keys endpoint but I can't get this to work with sendKeys, keys, or action(key).

I get this error when trying to call: await driver.action('key').down(Key.Tab):

[WinAppDriver] {"actions":[{"id":"action1","type":"key","parameters":{},"actions":[{"type":"keyDown","value":""}]}]}
[WinAppDriver] HTTP/1.1 500 Internal Error

[WinAppDriver] Content-Length: 117

[WinAppDriver] Content-Type: application/json

[WinAppDriver] 

[WinAppDriver] {"status":104,"value":{"error":"unsupported operation","message":"Currently key input source type is not supported"}}
[W3C] Matched W3C error code 'unsupported operation' to UnsupportedOperationError
[HTTP] <-- POST /wd/hub/session/565d2161-58cd-4aa7-aff2-9a3bdd8018c4/actions 500

Is it possible to finish implementing this method? I could take a crack at it, just wondering if it wasn't implemented for a certain reason.

liljohnak commented 10 months ago

@DiegoSalazar yep we're all stuck with this one. You need to downgrade your Selenium library; I think to 3.x

DiegoSalazar commented 10 months ago

Thanks for the reply @liljohnak can you provide a little more detail? I'm unclear on where I'd use selenium. My current tech stack is webdriverio typescript client talks to Appium which talks to WinAppDriver. Does selenium replace Appium in this case? Or webdriverio?

RakeshDangi-slt commented 9 months ago

Hi @DiegoSalazar , send keys is available but VIA element i.e webElement.sendKeys(testdata);, therefore craete an element where you want to type and then search the element and type on it,