How to insert Output Values in QTP?

In this blog post, we will see how to insert Output values in QTP.

An output value step is a step in which one or more values are captured at a specific point in your script and stored for the duration of the run session which can be used later across your actions.

You can output values like text, string from the objects, table cells, databases, and XML documents.

Following are the types of output values in QTP:

  • Standard Output Values
  • Text and Text Area Output Values
  • Table Output Values
  • Database Output Values
  • XML Output Values

In this example, we will see how to retrieve price for the Flight tickets when you book in Flights application using standard output values in QTP.

First step is to record your actions in QTP. But do not insert the order, because we need to retrieve the price of flights tickets. Once you entered all the details such as Date, Fly from and to, Name, number of tickets and quantity, navigate to Insert > Output Value > Standard Output Value… as shown below.

How-to-insert-Output-values-in-QTP-QAInsights How to insert Output Values in QTP?

Mouse pointer turns into hand icon, now click on the Price object which has the value. Object Selection – Output Value Properties dialog box opens up as shown below. Click on WinEdit: Price and then click on OK.

How-to-insert-Output-values-in-QTP-Object-Selection-–-Output-Value-Properties-QAInsights How to insert Output Values in QTP?

Now Output Value Properties dialog box opens up which lists all the property and its values for the Price object. Our aim is to retrieve price value, i.e. text, so check text property and then click on OK.

How-to-insert-Output-values-in-QTP-Output-Value-Properties-QAInsights How to insert Output Values in QTP?

Now complete the order and stop recording and go to expert view. You could see below snippet:

Window("Flight Reservation").WinEdit("Price:").Output CheckPoint("Price:_2")

Also you could see one new column should be there in Data Table as shown below. During run time, QTP captures the value and temporarily store it in Data Table.

How-to-insert-Output-values-in-QTP-Data-Table-QAInsights How to insert Output Values in QTP?

Now execute your script, in the result you can see the captured value in Run-Time Data Table as shown below.

How-to-insert-Output-values-in-QTP-Results-QAInsights How to insert Output Values in QTP?

Also output value details should get in the result tree as shown below. Similarly you can add other types of output values to your script to retrieve the values.

How-to-insert-Output-values-in-QTP-Detailed-Results-QAInsights How to insert Output Values in QTP?

I hope this article explained what transaction is and how to insert transactions in HP QuickTest Pro.

Happy Testing!

Thanks for visiting QAInsights!

We’re always posting interesting articles on QAInsights. I request you to subscribe so you don’t miss out anything.

Subscribe to our QAInsights YouTube Channel. Subscribe our free weekly newsletter or Google feeds.

NaveenKumar N

Hi there! is a passionate and experienced Software Test Engineer based in Mysore, India with skill sets in Manual Testing, Test Automation, Performance Testing, and Test Estimation. He loves to learn and experiment new trends and models in Software Testing. Please stop by at his personal blogs MyTechCube, NaveenKumarN.in, and certifications Testifications blog.

  • Nemesys660

    I need to store an output data but here’s the catch: I need a portion of the data to be stored. For instance if the output is 230000-6 I only need the number, without the “-6″.
    Is there a way to do that? Thanks.