licanhua / YWinAppDriver

A open source project provides WinAppDriver compatible functionality
MIT License
49 stars 10 forks source link

Working with selenium v4? #30

Closed paul-foreflight closed 2 years ago

paul-foreflight commented 2 years ago

Sorry to bother you, but you seem very knowledgeable on this subject. How can I make the appium server point to YWinAppDriver through the appium-windows-client? I want to (try to) use your driver as I think you may have fixed many of the issues with touch/action_chains/xpath (also, size and location calls). In another comment on the winappdriver you mention something like this: client <-> appium <-> appium-windows-driver <-> WinAppDriver I would like to make it: client <-> appium <-> appium-windows-driver <-> YWinAppDriver

I've tried connecting directly to YWinAppDriver, but I get the bad capabilities messages (expecting desiredCapabilities, got capabilities). I even tried cracking open your code and just directly inserting my app into the launch arguments but as soon as it got the capabilities back from appium it failed 😞, I guess I need this middle thing appium-windows-driver to do a lot of communicating that I just am not seeing.

I work on a larger project that includes other mobile platforms and neglected to test everything on winappdriver before we moved to the new selenium(v4.3)/appium versions, would this help me or do I just need to admit that I didn't properly vet the new versions before and see if we can move back to selenium v3?

licanhua commented 2 years ago

No matter WinAppDriver or YWinAppDriver, they are not fully w3c compatible. As I know, WinAppDriver has no plan to support it yet, also I have no time to implement an w3c version of YWinAppDriver.

That means you have to convert the w3c protocol to jsonwire protocol or implement the w3c endpoints based on YWinAppDriver. Also means that you may have problem to use newer selenium/appium which only support w3c implementation.

Otherwise you have to stay with old appium and selenium client.

I guess you don't need appium-windows-driver. So your connection may look like this:

client <-> appium <->YWinAppDriver

If you are using appium, possible you need to have appium prefix "appium:app": "Microsoft.WindowsAlarms_8wekyb3d8bbwe!App" in capabilites.

Who do bad capabilities messages, you have to check what is sent to YWinAppDriver. Expecting desiredCapabilities like below in the request.

      {"capabilities": {"alwaysMatch": {"appium:app": "Microsoft.WindowsAlarms_8wekyb3d8bbwe!App"}, "firstMatch": [{}]}, "desiredCapabilities": {"app": "Microsoft.WindowsAlarms_8wekyb3d8bbwe!App"}}
paul-foreflight commented 2 years ago

I've given up on this for now and moved our project back to selenium v3 :(