An Output value step, is step in which one or more values are captured at a specific point in your test and stored at a desired location. The stored values can be used as input at a different points in test script.
You can output a value to:
- A test or action parameter
- The run time data table
- An environment variable
Design Time Data Table – The data table which is present in UFT before running the test script is called Design Time Data Table. Design Time Data Table contains data to be used in the script while script is under execution.
Run Time Data Table – The data table which is present in UFT while script is under execution called Run Time Data Table.
Types of Output Values
- Standard Output values
- Text and Text Area Output Values
- Database Output Values
- XML Output Values
Standard Output values
We can use standard output value to output the object property values of objects. For example after inserting a order in e-commerce website need to collect order id from object for further verification.
Steps to create Standard Output values
- Click Record button, Select “Design>Output Value>Standard Output Value”.
- Click the object for which we want generate output value. Object selection box will open as shown below
- From Object Selection dialog box, select the object for which you want an output value, click OK. The output value properties dialog box opens for the selected object as shown below.
- Specify the Object property value and their settings.
- Click OK. QTP inserts an output value step in your test.
Text and Text Area Output Values
We can create a text output value from a text string displayed on the screen and can specify the text before or after the output text.
Steps to create Text and Text Area Output values
- Click Record button, Select “Design>Output Value>Text output Value or Test Area Output Value”
- Click the text string in the application for which want to create a text output value.
- The Text Output Value Properties dialog box opens as shown below.
- Specify the setting for the test output value.
- Click OK. QTP inserts an output value step in the test.
Database Output Values
You can use database output values to output the value of the contents of database cell.
Step to Create Database Output Values
- Click Record Button, Select “Design>Output Value>Database Output Value”. The database query wizard opens as shown below.
- Define the query to retrieve the data that you want to output.
- Specify the values to output and their settings.
- Click OK. QTP inserts an output value step in your script.
XML Output Values
Create XML output values from any XML document which contained in an XML Web page or frame, or directly from an XML file. You can output element and/or attribute values in an XML output value.
Steps to Create Output Values
- Select “Design>Output value>XML Output Value”
- Browse the XML file or enter the path of the file.
- Click OK. The XML Output Value Properties Dialog box opens.
- Specify the values to output.
- Click OK. QTP inserts Output value step in the test.