Thursday, 31 March 2011

How to work with Actions in QTP

Ways of creating the Actions:
1.       Creating the Action During Recording
2.       Creating the actions after recording
Navigation:
Go to insert menu à Select “Call to New Action” à Enter Action Name à Description à check the check box “Reusable Action” to make the action reusable à select location as At End of test or after current step. (Generally we will use the first option)

External Actions: A reusable action “xyz” created in test X, called into Test Y then, that ‘XYZ[testX]” is external action to “Test Y”, which cannot be edited. It is read only in “Test Y”.
Call to Copy Of Actions:
If an action is called using “Insert à Call To Copy of action”, the entire action will be copied to the current test along with its resources. The advantage is it can be modified according to your current test requirements. But, it increases the utilisation of memory. Use whenever necessary.
These modifications applicable to current test only.

Eg:
Action_Login created as reusable in testX
Called copy of Action_Login in to TestY - à COPY Action_Login or you can modify to Action_Login
You modify the Action_Login of TestY. This modification does not affect Action_login of TestX.
But, IF you call “Action_Login of TestY into TeSTA, then in TestA, you will get the Action_Login of TestY along with its modifications.
Split Actions:
An action can be split in Two Actions at a time.
Navigation for Split Action:
1.       Enter new line from where the action to be split
2.       Right Click à Select Actions à click Split Action à Select “Independent of Each Other” or “Nested Actions
3.       Enter Names for Action 1 and action 2

No comments:

Post a comment