WinAppDriver with Selenium Grid

November 10, 2019

What WinAppDriver can help you?

When you know much about selenium web driver, running another automation testing for windows application with winappdriver should not be a problem for you. And the best part for the automation testing, you have various programming languages to choose from.

In my project, I need to run automation test scripts on multiple windows based machines. In the past, we developed test scripts and performed them on each machine, so we had to collect the test result one by one. With the help of Appium, I get to try selenium grid to run multiple sessions on different machines in the meantime.

But in our use case, even though I can upgrade test machines to windows 10, most of the UI elements in our legacy windows application have difficulty to be located by inspect.exe. (something like, there is no unique className on the same page. Not sure if it’s caused by the way it was designed. ) Since we currently don’t have plan to modify the legacy program, the worse case for me is probably just run the scripts to send keystrokes for operating purpose and find other methods to verify the test results. (for instance, verify metadata created by certain operation)

Selenium Grid architecture

Every installation details can be found here. I am using MStest to write my c# test scripts with .net framework 4.72. First step is to nuget all the necessary selenium, appium and windriver packages. I include a .test.runsettings file to configure the location of testing data and report. I am also able to run it in command line by vstest.console.exe after build.

For setting up selenium grid, I use my local machine with JDK installed as the hub with jar file running. And I install node.js on my test machine. It will come with npm after installation. But using npm to install appium always get me older version of windows driver, I have to correct it by npm uninstall the old one and install the new one back. And then running appium with a JSON config file will register my node.

It is amazing to see those test scripts running on multiple windows based machines in parallel. It indeed saves our time to do the testing and operation work.