Categories
Uncategorized

Call to Existing Action in UFT ?

What is a Action in UFT ?

Action is a logical set of statements which provides structure to our automation testing.In simple words,Actions help us divide our test into logical parts.For instance our Application = ‘Booking Tickets”, can have action’s like Login to application, Book the ticket, Credit card payment and Logout .
Thus we can say an Action represents any specific activity that user performs
on an application.
Layman Example:-

UFT contains a  Test(Like Prime Minister of a country) and it comprises of multifarious actions(Like different department heads in a country, such as Finance,Education,Foreign ministers).


Now Test i.e. head of a country can call any minister (action) 
and these ministers (actions) can further call other ministers
(actions).

In nutshell everything is interrelated. Even a Prime minister holds
one ministerial position, on the similar track, by default Test 
contains a call to a single action. By creating test that call multiple actions, we can design test that are more modular and efficient. As for running a country single prime minister cannot handle all the things so it requires numerous ministers to make government run in a smooth manner so One Test comprises of single modular unit’s i.e. our  action.

By default each test in UFT represent one Action.

Function v/s Action in UFT?

Difference Action and Function in UFT
Function v/s Action in UFT



Action calls:

How we can include actions in our Test.

1. Call to copy of action.
2. Call to new action.
3. Call to Existing action.


Action call types in UFT
Action Call types in UFT

From the above picture we can make out the difference in the icons of all the action call types avaiable in UFT.

* symbol in front of “Call to New Action” depicts Inserting a New Action.

Call to copy of Action is like Inserting a local copy of an existing action, so we can edit and do any changes in the local copy, without affecting the original copied action.
+ symbol in front of “Call to Existing Action” depicts Inserting a call to existing re-usable action, we cannot edit it and all its components (datatable,OR) comes as readonly.

In our below example we have taken “Call to Existing Action”:


Methods to Add, Call to Existing Action:-

Approach 1:-
Select Design -> Call to Existing Action.

Add Action in UFT
Menu Bar insertion of “Call to existing action”




Approach 2:-
 In the Solution Explorer, right-click a test and select Call to Existing Action.

Adding Action in UFT from Keyword View
Keyword View


Approach 3:-
In the canvas, right-click anywhere and select Call to Existing Action.

Adding Action from Canvas in UFT
Canvas view


Approach 4:-
In the Record tool bar  click the Insert Action Call down arrow 
and select Call to Existing Action during a recording session

Call to Existing Action in Editor UFT
Editor(Expert view in QTP 11) 


Important Usage Points (Call to Existing Action):

i) We can insert a call to a reusable action that is stored in your current test (local action), or in any other test (external action).
Select Action window in UFT
Selecting the local or external action for “Call to Existing action”

Setting Relative/Absolute path in Action of UFT
Setting the relative path.



ii) Inserting a call to an existing action is similar to linking to it.Thus we can view the steps of the action in the action view, but we cannot modify them. The called action’s local object repository (if it has one) is also read-only. 

Datatable is coming as Read only
Called Action Data table is Read Only in called action.

iii)To modify a called, external action, you must open the test with which the action is stored and make your modifications there.

Properties Pane of Action in UFT
Properties pane to look the External Action properties/Add Parameters/Test  used(Right click on Action->Properties)

iv) The modifications apply to all tests that call that action. 
v)If we chose to use the original action’s data when we call an external action, then changes to the original action’s data are applied as well.


4 replies on “Call to Existing Action in UFT ?”

My thoughts are on using an Existing Action external. If that action has a ExitTest command in it, it stops the whole test? How does one return it back to the test that called to it and resume test?

I need to call an external action which contain linked function library as well as data table . While calling external action , only local object repository getting linked . Any solution to call function library plus data table along with the action ? Please help me.I am stuck here

Hey Sharaz,
Data Table values will be used by referring to origin action which was copied by 'call existing action'.

Leave a Reply

Your email address will not be published. Required fields are marked *