Tuesday, 18 December 2012

Creating an Output Value | QTP Tutorial PDF

Creating an Output Value

In the previous lesson, the second and third iterations of your test failed because the ticket price changed when the departure city changed. The checkpoint that checked the fare of the outbound flight in the Tutorial a Flight: Mercury page did not update its expected value as the fare changed.
In this Creating Output Values, you will create an output value that retrieves the outbound fare from the Select a Flight: Mercury page in each test iteration. You will then modify the table checkpoint you created, so that it checks that the price displayed in the Book a Flight: Mercury page matches the price captured in the Select a Flight: Mercury page.
1 Start QuickTest and open the Parameter test.
If QuickTest is not already open, choose Start > Programs > QuickTest Professional > QuickTest Professional.
➤ If the Welcome window opens, click Open Existing.
➤ If QuickTest opens without displaying the Welcome window, choose
File > Open or click the Open button.
In the Open Test dialog box, locate and select the Parameter test, then click Open.
2 Save the test as Output.
Select File > Save As. Save the test as Output.
3 Confirm that the Active Screen option is enabled.
If you do not see the Active Screen at the bottom of the QuickTest window, click the Active Screen button, or choose View > Active Screen.
4 Select the text you want to use as an output value.
In the Keyword View, expand (+) Welcome: Mercury Tours and click the
Select a Flight: Mercury page. The page is displayed in the Active Screen.
In the Active Screen, highlight the fare, without the $ sign, for the outbound flight (New York to San Francisco)—270. Right-click the highlighted text and select Insert Text Output. The Text Output Value Properties dialog box opens.
5 Set the output value settings.
Click the Modify button to open the Output Options dialog box.
The Name box displays Select_a_Flight_MercuryOutput_Text_out. Change this to depart_flight_price.
Click OK to accept the other default settings and close the Output Options dialog box. Click OK again to close the Text Output Value Properties dialog box. QuickTest adds the depart_flight_price column to the Data Table.
QuickTest adds the output value operation to the Select a Flight: Mercury page in the Keyword View.
6 Modify the table checkpoint that checks the ticket price displayed in the flight Summary table.
In the Keyword View, expand (+) Welcome:Mercury Tours > Book a Flight: Mercury.
Right-click Checkpoint "New York to San Francisco", and select Checkpoint Properties. The Table Checkpoint Properties dialog box opens.
Click column 3 in row 3 (the checked cell). In the Configure value area, select Parameter and click the Parameter Options button. The Parameter Options dialog box opens.

In the Name box, select depart_flight_price.
Click OK to close the Parameter Options dialog box. The Table Checkpoint Properties dialog box is redisplayed, with a parameterization icon next to the table value you parameterized.
Click OK to close the Table Checkpoint Properties dialog box. The checkpoint is now parameterized.
7 Save the test.
Select File > Save or click the Save button.

No comments: