Actions helps testers to divide scripts into groups of QTP statements called actions. Actions are similar to functions in VBScript, however there are few differences. By Default QTP creates a test with 1 action.
Actions | Functions |
---|---|
Actions are inbuild feature of QTP. | VBScript Functions are supported by both VBScript and QTP. |
Actions parameters are passed byvalue only. | Function parameters are passed either by byvalue or byref. |
Actions have extension .mts | Functions are saved as .vbs or .qfl |
Actions may or maynot be reusable. | Functions are always reusable. |
The properties of the action can be accessed by Right Clicking on the Script Editor Window and Selecting "Properties".
- Action Name
- Location
- Reusable Flag
- Input Parameters
- Output Parameters
Types of Actions:
There are three types of actions:- Non-reusable action - An action that can be called only in that specific test in which it has been designed and can be called only once
- Reusable action - An action that can be called multiple times any test in which it resides and can also be used by any other tests
- External Reusable action - It is a reusable action stored in another test. External actions are read-only in the calling test, but it can be used locally with the editable copy of the Data Table information for the external action
Working with Actions:
There are three options to insert an action. Click on each one of those to know more about the selected type of action.
Action Type | Description |
---|---|
Insert Call to New Action | Inserts a New Action from the existing action |
Insert Call to Copy of Action | Inserts a copy of an existing action |
Insert Call to Existing Action | Inserts a call to existing re-usable action |