Tutorial: Automate PyQt testing with PyAutoGUI
There are many tutorials available on the internet describing how to use PyAutoGui. Almost all of them focus on what commands are available and what operations they perform. I couldn't find any that explained how to actually launch the application under test before you run the PyAutoGui test script. This seems like an important omission. I concluded that they expect that the tester is going to manually launch the application under test and then separately launch their test script.
This is just not a workable scenario for many
system testing situations.
I'm going to want to start my application multiple times with different
configurations.
I need to automate that part just as much as automating
the functions within the application.
I want a solution that automates starting my application and running the testing script.
In addition, there were very few tutorials that discuss specifically testing PyQt applications with PyAutoGui. PyQt is a very popular GUI library and I'm sure many people would like to learn how to automate their GUI testing.
This tutorial answers those questions. The tutorial demonstrates a simple PyQt application and shows how to launch it as a separate process that's running in parallel with the PyAutoGui test script. You can configure different command line arguments to the application under test, and you can capture the console output for subsequent verification.