Wednesday 23 September 2015

Output Values in QTP

An output value step, is a step in which an object property value is 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. It is simply a value that is retrieved during the application is in run session and entered in our data table or stored in the form of a variable or a parameter. To extract these property values to the data table which can be used later as input to some other steps, testers use output values option. There are various categories or types of output values.
Types of Output Values
  • Standard output value
  • Text /Text Area output value
  • Data base output value
  • Xml output value (from application/resources)

Creating an Output Value is very similar to creating a Checkpoint. A  Standard output value can be used on any object to output value of any of its properties. You can select one or many properties from the same object as output.

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:
  • Select Insert>Output Value>Standard Output Value.
  • Click the object for which output value must be generated.
  • 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.
  • Specify the property value and their settings.
  • 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:
  • Select Test>Record.
  • Choose Insert>Output Value>Text output Value.
  • Click the text string for which you want to specify a text output value.
  • Select the object for which you want to specify a text output value and click OK.
  • The Text Output Value Properties dialog box opens.
  • Specify the setting for the output value.
  • 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

  • Select Insert>Output value>Database Output value.
  • Use the wizard to define the query to retrieve the data that you want to output.
  • Specify the values to output and their settings.
  • 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:

  • Select Insert>Output Value>XML Output Value.
  • In the XML file box , enter the path of the XML file.
  • Click OK. The XML Output Value Properties Dialog box opens.
  • Specify the values to output.
  • Click OK, QTP inserts n Output value step in your test.




No comments:

Post a Comment