Saturday, June 21, 2008

All about Actions

1. What is an action? And what are the different types of actions present in QTP ?
Action helps in making the test script more modular. You can call the action from the same test and you can call the action from another test too.
There are three types of actions in the QTP

  1. Non-Reusable (Normal): The kind of action can be called once and from within the test in which it is defined.
  2. Reusable Action: The kind of action can be called as many times as you want. And can be called in other tests too.
  3. External Action: This is nothing but the call to the reusable action of another test as a “call to existing action“. These are read only actions.

2. What are the different ways to call an action?
There are two ways to call the actions

  1. Call to Copy of Action:
    You can call any reusable or non reusable action as the copy of action. After calling the action you will be able to see the new action in the action flow. And then both actions will be different means the change in any of the action will not be reflected to the other action.
  2. Call to Existing Action:
    You can use call to Existing Action with reusable actions only.
      1. Calling Action from Same Test: If you are using Call to Existing Action to call the (reusable) action from the same test then you can edit the action but the changes will be reflected to the original action too and vice versa.
      2. Calling Action from Different Test: If you are using Call to Existing Action to call a action from different test then the action will be added as a External Action. And this will be read only action.
        You will be able to see this in the test flow with name as Action Name [Test Name]

1 comments:

Anonymous said...

Hi,

Hi,

I have "action a" in "Folder A". I copied the "action a" into "Folder B" and renamed the action-a as "action B" and did little modifications in action B, again I copied the same action-a in to "Folder B" and renamed the action-a as "Action C" and did little modifications... In a new action first I used "call to existing action" to call "Action B", again I called "Action C" using "call to existing action" option. But it reflects in the new action as "Action B"... Can anyone help me to resolve this..

Post a Comment