In Exercise 3b: Add steps to the FlightFinder action by recording, you reserved a flight from Los Angeles to Sydney. In those step, the Los Angeles and Sydney values are constant values. This means that UFT uses Los Angeles and Sydney as the departure and arrival city each time it runs the test.
In this exercise, you will create a new test, in which you define the departure and arrival city as a parameter, so that you can use a different departure and arrival city for each test run.
Start UFT and open the Book Flights test.
- Open UFT as described in Create a solution. Make sure that the WPF Add-in is loaded.
On the Start Page, in the Recent Solutions area, click Flight Reservation Application.
The Flight Reservation Application solution opens, containing the Book Flights test you created in Lesson 1: Create a GUI test and actions.
Save the Book Flights as Book Flights Parameter.
- In the Solution Explorer, select the Book Flights node.
Select File > Save As. In the Save Test As dialog box, browse to C:\%HOMEPATH%\My Documents\Unified Functional Testing and save the test as Book Flights Parameter.
In the Solution Explorer, the Book Flights test is replaced by the new Book Flights Parameter test. The Book Flights test is still saved separately in the file system.
Add the Book Flights test back to the solution.
You can have all of your tests open at the same time if they are both referenced from the same solution. This enables you switch back and forth between them if you want to compare or edit the tests. You can only run a single test at a time.
- Select File > Add > Existing Test.
- In the Add Existing Test Dialog Box, browse to the C:\%HOMEPATH%\My Documents\Unified Functional Testing, and select the Book Flights test.
Click Add to add it to the solution.
The Book Flights test is again displayed in the Solution Explorer. Note that it appears above the Book Flights Parameter test you just created, as tests are listed in alphabetical order.