Call to Existing Action in UFT ? – User friendly Tech help

What is a Action in UFT ?

n

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 .
nThus we can say an Action represents any specific activity that user performs
non an application.

n

nUnderstand Action Class in Selenium
n

n

Layman Example:-
n
nUFT 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).
n

n

Now Test i.e. head of a country can call any minister (action) 

n

and these ministers (actions) can further call other ministers

n

(actions).

n

In nutshell everything is interrelated. Even a Prime minister holds

n

one ministerial position, on the similar track, by default Test 

n

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.

n

nBy default each test in UFT represent one Action.

nFunction v/s Action in UFT?
n
n

n

n

n

n

n

n

n

Function v/s Action in UFT

n

n
nAction calls:
nHow we can include actions in our Test.
n
n1. Call to copy of action.
n2. Call to new action.
n3. Call to Existing action.

n

n

n

n

n

n

n

n

Action Call types in UFT

n

From the above picture we can make out the difference in the icons of all the action call types avaiable in UFT.
n
n* symbol in front of “Call to New Action” depicts Inserting a New Action.
nCall 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.
n+ 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.

n

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

n

Methods to Add, Call to Existing Action:-
n

n

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

n

n

n

n

n

n

n

n

Menu Bar insertion of “Call to existing action”

n

Approach 2:-

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

n

n

n

n

n

n

n

Keyword View

n

Approach 3:-

n

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

n

n

n

n

n

n

n

n

Canvas view

n

Approach 4:-
nIn the Record tool bar  click the Insert Action Call down arrow 

n

and select Call to Existing Action during a recording session

n

n

n

n

n

n

n

n

Editor(Expert view in QTP 11) 

n

Important Usage Points (Call to Existing Action):
n
ni) 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).

n

n

n

n

n

n

n

n

Selecting the local or external action for “Call to Existing action”

n

n

n

n

n

n

n

n

Setting the relative path.

n
nii) 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. n

n

n

n

n

n

n

n

Called Action Data table is Read Only in called action.

n

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

n

n

n

n

n

n

n

n

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

niv) The modifications apply to all tests that call that action. 
nv)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.n

Questions to Crack UFT Automation Interviews?

Was this article helpful?
YesNo

Similar Posts