When I firstly decided to automate our desktop application I faced with problem of choosing programming language and needed libraries.
As programming language was chosen Python 3.6 as more simpler and perspective.
Next step was choosing needed libraries. I’ve read a lot of sites about automation, many frameworks were shareware. And i’ve found pywinauto. For defining elements was used application SWAPY.
But after few days of work with pywinauto, SWAPY and our application I faced with problems like a launching of app, connecting to app (it was possible to connect to process id only), SWAPY don’t see a lot of elements in our application.
Then I’ve start to research of new approaches for automation and found Winium.Desktop Driver. Winium Driver – it’s a driver developed by 2GIS company for automation Desktop applications with using Selenium library. Driver helps run and connect to desktop applications and find elements with using Selenium. Winium can find elements by id, classname, xpath. For defining element names, id, we’ve used Visual UI Automation Verify application which included into Visual Studio.
I thought Winium + Seleium it’s a good idea and we’ve started our first steps in automation with this approach, before we faced with first problems. Many elements in our application doesn’t have automation id, and Winium can’t find elements in application by name or xpath. And the second problem of this driver it’s that you need to restart driver when you stop your tests, so stability of your tests on very low level.
Then I started research of pywinauto again. My second attempt was better than first, I’ve spent three days to understand how to connect and run application, how to define elements. For understanding that my approach is right, I’ve choose more complex module of application and try to go through all steps, and got success.