UFT Class 15
(Actions in UFT) Actions
What is Action?
Test- One or more actions to perform operations
Action – Set of statements or steps to perform operations
Statement/step – a minimal executable unit
Note: One test may have one or more actions
One statement / step may have one or more lines and vice versa
Purpose of Actions
Test1 (1 Action) Test2 (3 Actions)
——————————————————
Performance High Low
—————————————————–
* Reusability Less/No More
—————————————————
Readability Low High
————————————————
Locating Errors Diff Easy
Types of Actions
a) Reusable Action
It can be used multiple times in the Home tests and from other Tests
It can be called a s well as copied
Calling – Only execution, we can’t edit the code
(Centralized maintenance of Actions)
Coping – Execute and Edit the code
(No Centralized maintenance of Actions)
b) Non-reusable Action
It can be used only once in the Home Test
It can’t be called but copied
c) External Action
It is nothing but Reusable in the Home Test, calling Test point of view External.
Test1 Test2
——————————————————–
Login(Reusable) ————> Login (External Action)
Insert Order(Non-reusable) Open Order(Reusable)
Fax Order(Non-reusable)
Operations on Actions
Create New Action
Rename Action
Delete Action
Call to Existing Action
Copy Action
Make Reusable Action as Non-reusable and vice versa
Action Parameters
Input parameters
Output parameters
a) Create New Action
Navigation:
Create New Test
> Design menu > Call to New Action
> Enter Action Name (If you don’t want the default Name)
> Write Description (Optional)
> If want to create Non-reusable Action then Uncheck Reusable Action check box
> Click OK
Creating a Test using multiple Actions
Create New Test
> Create New Actions (One by one)
> Generate script for every Action
b) Rename Action
Select the Test
> Select required Action and Right click
> Select “Action Call properties”
> Change the Name
> Click OK
> Conform
c) Make Reusable Action as Non-reusable and vice versa
Note: We can create Reusable or Non-reusable actions while creating the actions or
After creating the Action.
Reusable to Non-Reusable:
Select the Test in UFT Editor View
> Select required Action and Right click
> Select Action Properties
> Uncheck “Reusable Action” Check box
> Click Ok
> Conform
Non-Reusable to Reusable
Select the Test in UFT Editor View
> Select required Action and Right click
> Select Action Properties
> Check “Reusable Action” Check box
> Click Ok
> Conform
d) Call to Existing Action
Design menu
> Call to Existing Action
> Browse path of the Test
> Select required Action
> Ok
e) Call to copy of Action
Design menu
> Call to copy of Action
> Browse path of the Test
> Select require Action
> OK
f) Delete Action
Select the Test
> select required Action and Right click
> Select “Delete Action”
> OK
g) Action Parameters
Input parameters
To pass input data, we can pass single value or multiple values
Purpose of Action Input parameters:
If we don’t use input parameters then fixed input data for every calling Action
If we use input parameters then we can pass different values and multiple values also.
How to Create Action input parameters
Select the Test
> Select Action and Right click
> Select Action Properties
> Select “Parameters” tab
> Add Input parameters one by one and set default value (If required)
> Ok
How to connect:
In Editor view
Type Parameter(“ParameterName”)
———————————————–
Assignment:
Give an example for Action Output Parameters
Follow me on social media: