Blog to understand automation concepts in QTP, Selenium Webdriver and Manual Testing concepts

Actions in QTP - Types of Action and Calling Actions

Actions help divide your test into logical units, A test comprises calls to actions.

Once a test is created, an action is created for the test. The Action is reusable by default. A reusable action can be called from various actions within the test or from external tests.
Creating multiple actions in test help to enhance reusability and modularize the tests. 

Types of Action:

Following are the types of Actions in QTP:

1. Reusable Actions

Can be called from multiple actions within or outside the test. An Action is reusable by default.

2. Non-reusable Actions

Cannot be called from other actions. Uncheck reusable checkbox while creating an action.

3. External Actions

This is a reusable action stored in another test.

4. Nested Action

An action called from other actions is nested action for the action from which it is called.

Calling An Action:

Action can be called in following ways: 

1. Call to Existing Action

We can view the steps of the action in the action view, but cannot modify them. The called action’s local object repository is also read-only

2. Call to Copy of Action

We can view the steps of the action in the action view and also modify the associated resources with the action. This action is non-reusable in the test.

3. Call to External Action

External actions can be called from the action by call to external action.
External Action can be called in expert view using LoadandRunAction as shown below:

LoadAndRunAction "Complete path of the test", "Name of Action"


Points to Remember about Actions

Some Important points to remember for Actions are as follows:

1. There can be maximum of 120 actions in a test.

2. For each action in a test, a new sheet in data table exists.

3. Data defined in global datasheet can be used by all the actions in the test.

4.Data defined in per action datasheet can be used by specified function only.

5. If we want to edit resources associated with a called action, use call to copy of action.

6. We can use input and output Parameter for an action, to get parameter value from an action.

7. Extension for actions is .mts

8. We can have multiple outputs from an action.

No comments:

Post a Comment