How To Work With Actions In QTP

September 26, 2010

Action: A Set of Statements code block for performing a/a lot  Task /Tasks. This is done for re usability. However for a conceptual thing action can be non Reusable as well.
kind of final class in java.

Types of Actions:

1) Non Re usable actions
2) Re usable actions
3) External actions

Operations on Actions:
• Creating Actions(Insert>call to new action>enter name of the action>click ok prepare scripts for those action)

• Splitting Actions(located default action>Edit menu>action>split action>Enter Action 1 name & action 2 name. Actually we need to create a default action --> create total script-->split the default action into different actions)

• Renaming Actions(Select the action-->drop down box--> edit menu-->action-->rename action-->modify the name>click ok)

• Deleting Actions(Select the action-->drop down box--> edit menu-->action-->delete action-->confirm deletion-->click ok)

• Calling an Action(Insert-->call to existing action-->browse path of the test-->select desired action-->click ok) just we need to remember once called an action we can not edit it.

• Copying an Action(Insert-->call to copy of action-->browse path of the test-->select desired action-->click ok) After copy we can edit this section as this is reusable.

• Making an Action Reusable/Non Reusable(Select Non Reusable action >edit >action>action properties>check reusable action check box >click ok)

If you are using action based framework or trying to add external /reusable action try to use reference or relative path of the action being added.

where can we save the OR files:

1. local drives
2. Can be uploaded to QC

How Action Based Test looks like

Test iteration is controlled using Run tab of test settings(navigation--File-->settings)
but action iteration is controlled from action call properties.

There are multiple frameworks available on Actions. Combination of Actions and functions.
But we must remember, the less the number of actions are inserted,the execution time will be faster. Actions take their own time to load and execute.
I suggest to use function driven approach rather than action driven. Actions are tightly integrated with QTP. So migration of project will be easy.

You Might Also Like