YWinAppDriver: An open sourced WinAppDriver

Canhua Li
2 min readNov 29, 2020

WinAppDriver is the UI automation tool recommended by Microsoft, and now there is an open-source implementation: YWinAppDriver. YWinAppDriver is compatible with w3c and selenium json wire protocols, so there is little effort for WinAppDriver user to switch from WinAppdriver to YWinAppDriver.

In Windows, the Microsoft UI Automation(UIA) is the user interface which provides programmatic access to allow user to manipulate the UI by means other than standard input. UI Automation allows automated test scripts to interact with UI.

WinAppDriver and other Microsoft internal automation tools use UIA too. WinAppDriver itself is an win32 application, and UIA API is too low level, so Microsoft open-sourced(binaries only) the core parts of WinAppDriver as Microsoft.Windows.Apps.Test in 2018 which was targeted to .net core and the open source WinUI project. To open source WinUI, Microsoft created Microsoft.Windows.Apps.Test which is a branch of WinAppDriver. WinUI used Microsoft.Windows.Apps.Test library and developed its own automation infrastructure.

On Oct, 2020, I created YWinAppDriver, a open-sourced WinAppDriver which is the combination of Microsoft.Windows.Apps.Test library and WinUI test infrastructure. My goal is to allow user to extend its own functionary(like Gamepad support, bugs WinAppDriver didn’t fix) on WinAppDriver via /session/:sessionId/execute. The execute endpoint is used to execute JavaScript and it’s supported by all selenium/appium clients, but it doesn’t make any sense for Windows application, so user can re-use this to extend the WinAppDriver functionality.

It’s very easy to try YWinAppDriver:

1. download it from Releases · licanhua/YWinAppDriver (github.com)

2. launch it from CLI like

WinAppDriver.exe — urls — basepath /wd/hub

Then you can user YWinAppDriver just like WinAppDriver.

If you are nodejs user, please just run:

npm install ywdio-ywinappdriver-service — save-dev
npm install winappdriver — save-dev
npx ywinappdriver

If you are WebdriverIO user, just add ywdio-ywinappdriver-service and update the config like below:

services: [“ywinappdriver”]