QTP10.com is a new and completely free website that offers help in all the versions of HP QTP (including latest version 10). More importantly, it offers free code for users of HP QuickTest Professioal. This site helps you in learning the basics of QTP and descriptive/advanced programming in (QTP) on various environments like - .Net, Infragistics, Web, Windows, etc.

Note -
This blog is NOT affiliated with HP / Hewlett-Packard in any way. The data/questions come from various sources and we have our own testing questions. I am just another Software Tester like you.

---------------------------------------------------------------------

Get updates and tips by Email, Twitter & Facebook. To Subscribe, Click on the respective image.




Sunday, July 5, 2009

Using Global and Action Data Sheets in QTP

Share This Post -

Sponsored Links:

 

When you output a value to the Data Table or add a Data Table parameter to your test, you can specify whether to store the data in the Global data sheet or in the action data sheet.

  • Choosing Global sheet enables you to create a new column or select an existing column in the Global sheet in the Data Table. When you run your test, QTP inserts or outputs a value from or to the current row of the Global data sheet during each global iteration. You can use the columns in the Global data sheet for Data Table output values or Data Table parameters in any action. This enables you to pass information between actions.
  • Each action also has its own sheet in the Data Table so that you can insert data that applies only to that action. Choosing Current action sheet (local) enables you to create a new column or select an existing column in the corresponding action sheet in the Data Table. Note that the name of the action sheet is the same as the name of the relevant action. When you run your test, QTP inserts or outputs a value from or to the current row of the current action (local) data sheet during each action iteration.

When there are parameters or output value steps in the current action's sheet, you can set QTP to run one or more iterations on that action before continuing with the current global iteration of the test. When you set your action call properties to run iterations on all rows, QTP inserts the next value from or to the corresponding action parameter or output value during each action iteration, while the values of the global parameters stay constant.

 

Note: If you create Data Table parameters or output value steps in your action and select to use the Current action sheet (local) option, be sure that the run settings for your action are set correctly in the Run tab of the Action Call Properties dialog box. You can set your action to run without iterations, to run iterations on all rows in the action's data sheet, or to run iterations only on the rows you specify.

 

For example, suppose you want to test how a flight reservation system handles multiple bookings. You may want to parameterize the test to check how your site responds to multiple sets of customer flight itineraries. When you plan your test, you plan the following procedures:

  1. The travel agent logs into the flight reservation system.
  2. The travel agent books five sets of customer flight itineraries.
  3. The travel agent logs out of the flight reservation site.

When you consider these procedures, you realize that it is necessary to parameterize only the second step—the travel agent logs into the flight reservation system only once, at the beginning, and logs out of the system only once, at the end. Therefore, it is not necessary to parameterize the login and logout procedures in your test.

 

By creating three separate actions within your test—one for logging in, another for booking a flight, and a third for logging out—you can parameterize the second action in your test without parameterizing the others.

 

Go Back to: Working with Actions in QTP

SPONSORED LINKS: