QTPro Parametrization

1.Objectives
2.Describe and use multiple parameter types.
3.Drive data in multiple iterations.
4.Analyze errors during iterations.
5.Parameterize a checkpoint.
Input Parameters For Data driven Tests :
-Input Parameters For Data Driven Tests
-A data-driven test is one that runs a set of user actions with multiple input values. -Data driving allows one script to test application functionality with many sets of data.
-Automated data driven testing frees you to perform more tests, thus increasing test coverage. Speed, repeatability, free resources to do other kinds of quality control.
Input Parameter
-Input Parameters allow you to replace a static, recorded value in a step with a dynamic placeholder (parameter), which represents an expandable range of values.
-Input parameter names and their values are located in QuickTest’s Data Table.
-Input parameter values are input into the application from some outside data source.

Steps to Create An Input Parameter :
To create an input data table parameter:
-Select the step in the Keyword View that contains the recorded input value.
-From the Value column, click on the current value.
-Click on the parameterize button.
-The Constant value appears in the Value Configuration Options dialog box.

Set the Parameter Value :
-In the VALUE CONFIGURATION OPTIONS dialog, select the Parameter radio button and ensure that Data Table is selected from the drop-down list.
-From the Name drop down list, enter a unique column name to create a new column in your data table or choose an existing column name from the data table.
-Use the default Global data sheet to store values.
-Enter the values that QTP will input after the test executes.

Supply Data to the Parameter :
-The design-time table is the central location for storing input parameter values.
-The number of rows in the data table will cause the same number of test execution iterations to be run.
-As a default, the design-time data table is displayed at the bottom of the QuickTest screen.
-If you want to show or hide the data sheet, click on the icon in the toolbar.

Verify The Test Run :
-View the Test Results window to verify that each of the rows from the Design Time Data Table was used during the test run.
-Expand the tree for each iteration (Row#) to view specific information about the execution of the specific row.

Parameterize a Checkpoint :
-You can use parameterized expected values to make your checkpoints dynamic. They Can be set on:
-An object property in the Object Repository.
-A checkpoint on a parameterized field

A Test with Multiple Actions :
-Actions can be divided into logical sections, like the main sections of a transaction, or by specific business processes.
-When you create a new test, it contains one action. By dividing your tests into multiple actions, you can design more modular and efficient tests.

Types of Actions
There are two kinds of actions:
1.Regular (Non-reusable)
2.Reusable
Tests that contain reusable actions can be used:
1.Locally
2.Externally

Insert Call to a New Action :
-You can add a new action during or after recording.
-Select Insert ? New Action from the QuickTest main menu. The Insert New Action window appears.
-Or use the “logo” icon on the toolbar to insert new action.

Using Parameterized Data :
-Test data can be passed from one test to another test using the value of an input parameter.
-This creates a data flow between business processes.
-The value passed from one business process to another will come from the Data Table.
-Be aware of any data dependencies that occur within the business process.

Copied, Existing or New Action :
-After reusable actions are created, they can be called into a “Main Calling” test in three ways:
-Call to New Action
-Call to Copy of Action
-Call to Existing Action

Set Actions as Reusable :
-Create a reusable action from the Action properties dialog.
-Check the checkbox and click OK. A message will appear stating a description of a reusable action.

Call An Action :
-You can do number of things with a reusable action, such as:
-Call it multiple times within a test.
-Call it from other tests.
-View the components of the action tree (you cannot modify them except in the original script)
-Insert a call to an external action (the action is inserted in read-only format) as local editable copy use the (read only) data from the original action
-Insert copies of non-reusable actions into your test, but you cannot insert calls to non-reusable actions.

One Action used Many Times :
-Rather than recording the login process three times in three separate tests, and enhancing this part of the script (with checkpoints and parameterization) separately for each test, you can create an action that logs into the application in one test.
-Best Practice
Inserting calls to existing actions makes it easier to maintain our tests; when an object or procedure in your application changes. It only needs to be updated one time, in the original action.


Set Actions as Reusable :
-Create a reusable action from the Action properties dialog.
-Check the checkbox and click OK. A message will appear stating a description of a reusable action.

On Action – Two Names :
-Use the Action Properties – General tab to modify the default label.
-This makes the test easier for others to understand when viewing the test from the Keyword View tree.
-Right-Click on Action and enter a logical name for the business process.

External Action Properties :
-An external action is a reusable action created in another test. The external action is inserted into the calling test in a read-only format.
-Data from the external action’s data sheet can be imported as a local, editable copy or kept as read only. If read-only, the data can only be modified from the original test.
-After a reusable action is called, you will see the parameters contained in each test appear in the Global or Local sheet depending on where you stored them in the original test.

Action Run Settings :
-Since there are two (or more) tests running, one right after another, you may need to specify the iteration for each separately.
-To affect the run settings for a particular action, set them in the Action Call Properties dialog box.
-Right-Click on the Action label in the Keyword View, and choose Action Call Properties from the list provided.

Defining an Action :
-The Action Properties dialog box enables you to define options for the stored action.
-You can modify an action name, add or modify an action description, and set an action as reusable.


Passing Values to a Called Action :
-You can also define input and output parameters to be used by the action.
-These settings apply each time the action is called.

Using an Action Parameter :
-Once parameters have been set in Action Properties, you can tell QTPro that the parameter type being used is an Action Parameter.

The Test Flow List :
-The Test Flow List:
1.Changes with the addition of a reusable action.
2.Enables viewing of the action tree for a selected reusable or external action.
-The test flow appears when a test is recognized as having called actions in your test.
-An action tree displays all the details of the selected reusable or external action.

Action Data Structure :
In the Action data structure, each Action will have its own:
-Folder with an object repository
-Local data table sheet
-Run settings
Multiple Reusable Actions :
When using multiple, reusable actions, keep the following in mind:
1.Actions can be called or copied from another test.
2.Run settings have to be set per action
3.As a default, all actions in a test use the same shared Object Repository.
4.Parameters and data from the called test are reflected in the calling test
5.An action can be deleted or an action call can be deleted.
6.Position your action calls separately or nest them with other actions.
Delete an Action :
-Because reusable actions can be used throughout your test or test set, when you delete an action, you must decide to delete a specific occurrence of the action and/or all of its calls.

-A confirmation message(yes/no) appear when you are about to delete a non-reusable action.

No comments:

Post a Comment