Even though Squish focuses on automating GUI applications it is possible to do some limited testing of console applications by using
cmd.exe and some small workarounds.
It is important to note that recording key presses is not possible when using
cmd.exe as application under test (AUT); however, you can send key presses to it via
Let’s imagine that we have the following simple batch file
To test this we can write a Squish test script which automates the following via the type() command and other functionality in Squish:
Sending text input to mimic the user
Marking the complete text contents of the
Copying the complete text contents of the
cmd.exewindow into the system clipboard
Here is such a test script written in Python:
Use in other Squish packages¶
It is still possible to automate Windows shells from within Squish for Qt for example. For this a running server from a Squish for Windows Package is required on the system.
In the startApplication call that starts the shell, you additionally need to pass the port for the Squish for Windows Server.
Also you will need a call to testSettings.setWrappersForApplication , to set the wrappers for the Windows shell toWindows, if you are running a test suite that is configured for a different wrapper.