| Version 3.4.4 |
| Creating a Test-suite [45-60 min] |
| Introduction |
This chapter will take you through the steps necessary for creating your first test-suite:
| Starting the Application |
Open a new (empty) test-suite from QF-Test with the »File«-»New Suite« menu option. Please be aware the "old" test-suite remains open as a different window.
Make sure that the detailed view is turned on, it can be toggled with the »View«-»Show Details« menu option. You now see the divided window with a tree on the left-hand side and a pane on the right-hand side representing the details of a selected node. Using the tree you can navigate through the test-suite's nodes; when you select a node, you'll see its properties appear within the details pane on the right.
At the beginning the application to be tested needs to be started from QF-Test. In this case it will be the browser showing the "Web demo" page which is already known from the previous chapter. The QF-Test Quickstart Wizard will help us to create an appropriate setup sequence.
Please open the Quickstart Wizard via the »Extras« menu. He should welcome you as shown in the figure below. After saying a short hello please press the "Next" button.
|
| ![]() |
||
|
| Figure 13.1: The Quickstart Wizard | ||
Next you can choose the type of application to be tested. Please select "A web page in a browser" and continue.
|
| ![]() |
||
|
| Figure 13.2: Select type of SUT | ||
Now you are asked about the URL of the web page to be tested which will be the "Web
demo" page. The simplest way to enter it is to open the file browser by
clicking the
button on the right
side of the text field and navigate to the qftest-x.y.z version specific directory and
from there to .../doc/tutorial/web/en where you can select the
index.html file. Afterwards please proceed to the next wizard step.
|
| ![]() |
||
|
| Figure 13.3: Specification of the URL. | ||
On the next pane you are asked whether your web application to be tested is based on an AJAX toolkit. As our demo does not use one of those toolkits, simply proceed to the next wizard step.
|
| ![]() |
||
|
| Figure 13.4: AJAX toolkit. | ||
It's time now to select the browser to use. On Windows it's most likely the Internet Explorer which is already preselected and we will choose that one for our first own test. As also Internet Explorer compatibility mode is not relevant for our web demo page test you can simply press "Next".
|
| ![]() |
||
|
| Figure 13.5: Browser selection. | ||
This step gives us the option for some basic browser settings. You can simply keep the proposed settings and continue.
|
| ![]() |
||
|
| Figure 13.6: Browser settings | ||
As we only want to work with one browser window, you can also continue at the next step without any change.
|
| ![]() |
||
|
| Figure 13.7: Browser window name | ||
It's nearly done. We have just to assign a name to our client as a reference. Let's simple call it "web". Please let the check box on the page untouched empty and press "Next".
|
| ![]() |
||
|
| Figure 13.8: Client name | ||
Finally some information is given about what to expect when the wizard finishes its task of creating a setup sequence and where to find help in case of troubles. Please disable the "Start automatically" option, as we first want to take a look at the generated setup sequence and start it by hand. Now please press "Finish".
|
| ![]() |
||
|
| Figure 13.9: Final Information | ||
The generated setup sequence appearing under the "Extras" contains four main steps:
This might look a bit circumstantial in the first place but leaves room for possible required adaptations in a direct way. Expanding the four seqences reviels the details of each step.
|
| ![]() |
||
|
| Figure 13.10: Generated Setup Sequence | ||
qfs.qft standard library with respective parameters.
You can have a look at the details of some of the node if you like. Basically you will find the values you provided during the Wizard steps assigned to the respective node attributes.
Now we want to see some action. Please ensure the "Setup" node is selected. Then
click the
replay button or simply hit "Enter".
After a few second the browser window is expected to appear showing the web demo page similar to figure 12.5 from the previous chapter:
| Adding a Clickstream Test |
You're now ready to add a simple clickstream test.
|
| ![]() |
||
|
| Figure 13.11: The Recorded Clickstream | ||
The name of the recorded sequence will be entered in a standard fashion by QF-Test as the time and date of the recording. You can change this name as you see fit by simply clicking on the node and changing its properties in the details view on the right.
Inside the sequence, beside "Mouse click" nodes there are also two "Wait for document to load" nodes. QF-Test creates such automatically when a new document gets loaded. In our case that's on the initial change to the "Radio buttons & check boxes" page and after pressing the "submit" button, which also cause a reload.
We want to replay the newly created sequence right away for verification. In advance we may
not forget to change to the "Welcome" page as this was the starting point of the
recording. Then we select the sequence node and execute it using the
button. You
should now see your exact sequence of mouse and keyboard events replayed within the browser
window.
Before creating a more complex test we will first structure the recorded sequences into a test-suite.
| Building a Test-suite |
So far we have worked in the "Extras", which is a kind of sandbox for experimenting. Now we want to create a real test-suite.
At first please select the "Test-set" node an change its name to e.g. "Webdemo". Next expand the node and change the name to the enclosed "Test-case" node e.g. to "Clickstream".
Then we need to move the setup sequence from the "Extras" into the test-set, at the first position to be more specific, that means before the "Clickstream" test-case. Moving the "Setup" node can be accomplished with mouse (Drag&Drop), context-menu (use a click of the right mouse-button) or with the [Control-X] (cut) and [Control-V] (paste) keyboard commands.
Note When using Drag&Drop a target node can be expanded by having the mouse cursor hovered above the "+" left of the target node.
Now it's time to move your recorded Clickstream sequence from the "Extras" node up into the "Clickstream" test-case node. If the sequence still has the time stamp as name, you might want to turn it into something more meaningful.
Lastly you can create a "Cleanup" sequence to stop the application. This sequence contains two nodes: One to stop the client and one to ensure that it actually terminated. From the figure below, you should be able to see what nodes are necessary to carry out this little exercise (you might want to look under "Dependencies" and "Process nodes").
|
| ![]() |
||
|
| Figure 13.12: The Organization of your Test-suite | ||
Now you've completed the most important steps of structuring a test-suite. In the following section you'll extend your test-suite by introducing a check of a specific text-field.
| Adding a Text Check |
Let's create a little more complex test in which we will fill a form and check the result string.
|
| ![]() |
||
|
| Figure 13.13: Recording a Text Check | ||
Choose "Text" from the popup menu, return to your test-suite window and
stop recording using the
button.
Note Instead of returning to the test-suite to activate the check
mode by pressing the
button, you can also
utilize [F12] while remaining in the SUT. This hotkey
activates/deactivates the record check mode.
You should now have the know-how to organize the recorded sequences into a test-case. You can compare your results with the way we organized the suite and renamed the sequences. Additionally we transformed sequences into "Test-step" nodes which specify them more clearly and make them also visible in the test report.
|
| ![]() |
||
|
| Figure 13.14: The Text-Check Test Organized into the Tree Structure | ||
Note Transformation of nodes can be easily done via menu »Operations«»Transform node into« or also a nodes context menu.
At this point, you can give your new test a shakedown run. Stop the SUT
client now if it is running, click on the root test-node, and start
execution by hitting the
replay
button. Does anything work as expected?
The result of the test-run is stored in the run-log. To view it, use either the »Run«-»1. ...« menu option or take the short-cut [Control-L].
|
| ![]() |
||
|
| Figure 13.15: The Run-Log of Your Test | ||
Within the run-log you see that the "Setup"/"Cleanup" pair is executed before and after each test-case.
Note Starting and stopping the SUT before and after each test-case is a safe way for a proper state but a time consuming one. Typically you will try to start the SUT only once and use others methods for resetting it to a defined status.
In this test there were no errors or exceptions in the test-run. But you can see yellow frames around some nodes, which indicate warnings. In case of the webdemo they are caused by components which have no name assigned. We will not dicuss those warnings here any further, but you will find detailed information on the importance of component names in the user manual.
Upon closing the run-log window you will be prompted if you want to save the run-log (since it will only be available until QF-Test ends).
Let's modify the test now so that we cause an error in the text-check. Click on your "Check Text" node so that you see its details displayed:
|
| ![]() |
||
|
| Figure 13.16: Properties of the "Check Text" Node | ||
In the "Text" field you see the value that QF-Test expects. Change this text to some other arbitrary value and re-run the test.
Now when you replay the test, a dialog box appears at the end indicating that there was an error."
If you open the run-log, you'll see that red-fields now enclose certain nodes, indicating that some error occurred inside the child-nodes. You can use the run-log menu option »Edit«-»Find next error« to jump directly to the node which caused the error or use the [Control-N] keyboard shortcut.
To correct your check node again you can use a helpful feature in QF-Test. In the run-log simply click right on the node indicating the mismatch and select "Update check nod with current data" from the context menu.
We did it. Your first test-suite is completed. Finally you might want to save it.
| Last update: 01/27/2012 Copyright © 2002-2012 Quality First Software GmbH |