Tuesday, January 10, 2012

QTP : Output Values

An output value step is a step in which one or more values are captured at a specific point in your test and stored for the duration of the run session. the values can later be used as input at a different point in the test run.
You can output a value to:
  1. A test or action parameter
  2. The run time data table
  3. An environment variable
Design Time Data Table
The data table which is present in QTP before running the script is called Design Time Data Table. This contains various data to be used in the script while script is under execution.


Run Time Data Table
This is the data table you see while QTP script is under execution. At the starting of the script execution QTP copies the data from Design Time Data Table to Runtime Data Table and add, delete or change the data in the Run Time Data Table during script execution. At the end of script execution QTP exports the Runtime Data Table to the Test Results Sheet.

Why Run Time Data Table

If QTP directly modifies data in the DTD  table then we cannot use same data table for the next execution of the script since the data has been modified from initial execution. hence to ensure that the same script can be executed  without modifying the data in the data table. QTP does changes to the data only in Run Time Data Table without affecting the Run Time Data Table.

Using QTP you can create the folowing categories 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 values to output the property values of most objects. For example after reserving a ticket, it must be confirmed. In this case confirming the ticket number is required which is generated during run time. you could create an outpuut value in your test to store the ticket number after it is generated during run time. Steps to create standard output value:
  1. Select Insert>Output Value>Standard Output Value.
  2. Click the object for which output value must be generated.
  3. In the Object Selection dialog box, select the object for which you want to specify an output value, and click OK. The output value properties dialog box opens for the selected object.
  4. Speccify the property value and their settings.
  5. When you finish defining the output value details , click OK. QTP inserts an output value step in your test.
Text Output Values We can create a text output value from a text string displayed on the screen, we can define the output value as part of the displayed text and you can specify the text before or after the output text.
Steps to create a text output value while recording :
  1. Select Test>Record.
  2. Choose Insert>Output Value>Text output Value.
  3. Click the text string for which you want to specify a text output value.
  4. Select the object for which you want to specify a text output value and click OK.
  5. The Text Output Value Properties dialog box opens.
  6. Specify the setting for the output value.
  7. when you have finished  defining the text output value details, click OK. QTP inserts an output value step in the test.
Database Output Values
you can use the database output values to output the value of the contents of database cell.

Steps to create database output values
  1. Select Insert>Output value>Database Output value.
  2. Use the wizard to define the query to retrieve the data that you want to output.
  3. Specify the values to output and their settings.
  4. When you have finished defining the output value details, Click OK. QTP inserts an output value step in your script.
XML Values Output
You can create XML output values from any XML document 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 step.
Steps to create XML output values from XML file:
  1. Select Insert>Output Value>XML Output Value.
  2. In the XML file box , enter the path of the XML file.
  3. Click OK. The XML Output Value Properties Dialog box opens.
  4. Specify the values to output.
  5. Click OK, QTP inserts n Output value step in your test.




5 comments:

  1. This comment has been removed by the author.

    ReplyDelete
  2. This comment has been removed by the author.

    ReplyDelete
  3. This comment has been removed by the author.

    ReplyDelete
  4. good one

    regards,
    Neha
    https://speakingdots.com

    ReplyDelete
  5. good one

    regards,
    Neha
    https://speakingdots.com

    ReplyDelete