![]() ![]() squishrunner directs the AUT to perform whatever actions the test script specifies.Īll the communication takes place using network sockets which means that everything can be done on a single machine, or the test script can be executed on one machine and the AUT can be tested over the network on another machine. With the hook in place, squishserver can query AUT objects regarding their state and can execute commands on behalf of squishrunner. The hook is a small library that makes the AUT's live running objects accessible, and allows communication with squishserver. squishserver starts the instrumented AUT on the device, which starts the Squish hook. The test script is executed by the squishrunner tool, which in turn connects to squishserver. Squish runs a small server, squishserver, that handles the communication between the AUT and the test script. The ability to do remote testing is particularly useful for testing AUTs that run on multiple platforms and for testing AUTs that run on embedded devices. For example, it makes it easier to store the test scripts in a central location and to perform remote testing on different machines and platforms. In addition to insulating Squish and test scripts from AUT crashes, running the AUT and the test script in separate processes brings other benefits. In such cases, the test script will fail gracefully and log an error message. This ensures that even if the AUT crashes, it should not crash Squish. One fundamental aspect of Squish's approach is that the AUT and the test script that exercises it are always executed in two separate processes. An application to test, known as the Application Under Test (AUT).In the following sections we will create a test suite and then create some tests, but first we will very briefly review some key Squish concepts. You need to do this only once per example AUT, and not at all when testing your own AUTs. Some versions of Squish automatically open this dialog if no AUT is specified. To recover from the error, click the Test Suite Settings toolbar button, and in the Application Under Test (AUT) section, choose the AUT from the combobox if it is available, or click the Browse button and navigate to the AUT's executable in the finder dialog. The first time you try running a test for one of the example AUTs, you might get a fatal error that begins Squish couldn't find the AUT to start. The screenshot shows the application in action with a user adding a new name and address. The exact location doesn't matter, so long as you mentally translate the SQUISHDIR directory to whatever the directory really is when you see paths and filenames in this manual. This means the directory where Squish is installed, which might be C:\Squish, /usr/local/squish, /opt/local/squish, or something else, depending on where you installed it. ![]() Note: Throughout the manual, we often refer to the SQUISHDIR directory. ![]() For more examples of testing Qt-specific features including models, view models, and views, as well as all the standard editing widgets, see How to Create Test Scripts and How to Test Qt Applications. All the ideas and practices that you learn to test this application can easily be adapted to your own applications. It supports in-place editing and also has a pop-up modal dialog for adding items. Despite the application's simplicity, it has all the key features that most standard applications have: a menu bar with pull down menus, a toolbar, and a central area-in this case showing a table. This is a very basic application that allows users to load an existing address book or create a new one, add, edit, and remove entries, and save (or save as), the new or modified addressbook. The application is shipped with Squish in SQUISHDIR/examples/qt/addressbook. We use a simple Address Book application as our AUT. Therefore, it is worth knowing how to use the command line tools that can be run from batch files or shell scripts. For example, to do nightly runs of your regression test suite. Using the Squish IDE is the easiest and best way to start, but once you build up lots of tests, you will want to automate them. Whenever we show how to achieve something using the Squish IDE, we will follow with an explanation of how to do the same thing using the command line tools. Squish comes with an IDE and command line tools. Tutorial: Starting to Test Qt Applications
0 Comments
Leave a Reply. |