Subscribe by Email


Wednesday, September 12, 2012

How will you call from one action to another action in QTP?


In the test scripts produced with the help of quick test professional, one action can be called from another action. In this article we are going to discuss the same i.e., how this can be done? 

How to call from one action to another action?

- A call to a reusable action can be inserted easily that might be stored in some local test (current test) or in some external test (external test). 
- Calling one action from some other action is just like inserting an action call in an existing action or just linking it to it.
- The steps involved in this whole process can be viewed using the action view tool but they cannot be modified. 
- The local object repository of the action that has been called is read only. 
- It is not necessary that each and every calling and called action must have a local object repository. 
- It may or may not have a repository.
- If the external action that has been called has some data in the data table, you get two options:
  1. Either you take the data from the data sheet of the action and import it as a editable or local copy,
  2. Or you take the data from the original action but here the data is read only type.
- The data obtained from the global data sheet of the action that has been called is imported to the test as an editable and local copy of data.
- In order to modify an existing external action you need to open the particular test where you have the action stored and make modifications there itself. 
These modifications will be visible in all the tests that will call that particular function. 
- If you choose to go for the second option as mentioned above then the changes that you will make will apply to original data as well. 

Step by step procedure of how a call to an action can be inserted?

  1. Go to insert menu, the select the “call to existing action” option and you will be provided with a list of actions. From that select “insert call to existing action” or you can also right click on any of the steps. The go for the action button and then click on “insert call to existing” option. Now a action properties dialog box pops up.
  2. There is a browse button called “from test” and can be used to find the test that holds the action to be called. All the reusable actions in the test that you select are displayed in this action box.
  3. From the action that is displayed select the action that is to be called and its type as well as description both are displayed if available. This type and description help you further in proper identification of the action that you wish to be called.  You can even set other properties of the actions by going to the “setting general action properties”.
  4. Now you are done with setting the properties, decide on where the function has to be inserted. For inserting the function you are provided with two options namely:
a)   After the current step or
b)   At the end of the test
There is one thing to be noted which is that if the step that is in current selection is a reusable action from some another test, then the action call is added at the end of the test automatically.
  1. Now the last step is to just clock on the OK button and you have your action inserted. This action can be moved to any other desired location by just dragging it to that position.


No comments:

Facebook activity