Automation Testing Tutorial | Actions Basics

Actions Basics

Each QuickTest test comprises calls to actions. QTP Actions are units that divide your test into logical sections. When you create a new test, it contains a call to one action. By dividing your tests into calls to multiple actions, you can design more modular and efficient tests.

QuickTest lets you insert several types of actions into tests. An internal action is an action that is stored in the local test (also known as a source test). An external action is a referenced call to an action that is stored in a different test. For example, you may have an action that you want to use in multiple tests—you would store the action as an internal action in one test and insert calls to that action from other tests. In the other tests the action would be available as an external action.

When you insert a call to a new action, it is reusable by default, enabling you to insert calls to the action from any test. Reusable actions are especially useful when you have a process that you may need to include in several tests, such as logging in to your application, or that you may need to insert several times in the same test, such as filling in user credential dialog boxes that open whenever a user tries to access a secure part of your application. Reusable actions can be internal or external actions.

When you insert calls to existing (reusable) actions, they are read-only in the calling test. You modify them in the test in which they are stored.

Inserting calls to existing qtp actions enables you to create and enhance your action’s test steps only once and then to call the same action from several tests. This makes it easier to maintain tests, because when your application changes you only have to update the existing action stored with the original test. This also helps ease test maintenance because when you modify these actions, all tests containing calls to these actions are updated. This enables you to create and enhance your action’s test steps only once and then insert calls to the existing actions as needed from any test. If you plan to use the same or similar actions in many tests, you might consider creating a repository test to store your reusable actions. Then you can insert calls to these existing actions from other tests, linking these actions to the source test.

You can also insert a copy of an action in your tests if you plan to make changes to the action steps. This inserts the action as an internal action in the current test. Copies of actions are not linked to the source test, so that when you insert a call to a copy of an existing action, you can make changes to the copied action, and your changes will neither affect, nor be affected by, any other test.

If you want to prevent an action from being reused in any test, you can make it non-reusable. Non-reusable actions are internal actions that can be used only once.

QTP 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 in built feature of QTP. VBScript Functions are supported by both VBScript and QTP.
Actions parameters are passed by value only. Function parameters are passed either by byvalue or byref.
Actions have extension .mts Functions are saved as .vbs or .qfl
Actions may or may not be reusable. Functions are always reusable.

Test Your Automation Testing Skills By Taking Our Free Practice Tests On This Link

Get industry recognized certification – Contact us

Menu