Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 7

UFT:

UFT is one tier application.

UFT is standalone application doesn’t have database.

Generating basic tests

Object repository based test design:

Two methods

1) Record and run tests


2) Keyword driven methodology

Record and run tests:

What is test recording?

UFT generates steps for every user action on AUT and simultaneously stores objects information
into object repository

Steps for recording:

Select record:

Record menu-record

Or select record command from the tool bar

Or use short cut key F6

Click ok

Navigate the application

Stop recording

After recording

1) UFT generates steps/statements for all user operations on AUT


2) UFT stores object information in to object repository.

What is test run/execution?

Put Base state. (Required state for running the test)

Select run command

Run menu-run

Or select run command from the tool bar

Or use short cut key F5


Click ok

During test execution UFT reads statements one by one from editor and gets objects information
from the object repository, based on that information performs operations on AUT.

Scenario 1:

One or more object information not available in object repository: error

Scenario 2:

Extra objects information available in object repository: no error and it will execute

Recording modes

i) Normal recording:
It is also called as standard recording or context sensitive recording.
It is default recording mode.
It records mouse clicks and keyboard operations based on objects.
For each operation there will be individual steps will generate in the script.
Drawback: Unable to record mouse continuous operations.
First select normal record mode and then select analog or low level record mode.
Without select normal record mode we can’t select other modes.

ii) Analog recording


It records mouse clicks, keyboard operations and mouse movements with respect to
desktop or specified window coordinates based.
It records user actions on AUT based on x, y co-ordinates based on user selection.
There are two types of options
a) Record relative to the screen—particular screen and particular position. Position cannot
be changed
Desktop.run analog “track1”
b) Record relative to the following window- particular to the window. Position can be any
place.
Window(“windowname”).run analog “track1”
Analog record is useful for drawing and digital signatures.

Drawbacks:

1) It occupies more memory than normal recoding then UFT execution performance
will be decrease.
2) It doesn’t generate steps for every user action on AUT, it records all user actions in a
track file, so test is not readable as well as editable.
iii) Low level recording
It records some operations on non-supported environments.
Drawbacks:
1) It occupies more memory than normal recoding then UFT execution performance
will be decrease.
2) Low level recording considers all objects in two category only
Window-parent, Winobject-child object. So test script is not readable.

iv) Insight recording:


Extension of low level recording.
It records some operations on non-supported environments and captures object images
also.
Drawbacks:
1) It occupies more memory than normal recoding then UFT execution performance
will be decrease.
2) Test is not readable.

Advantages of recording:

i) Easy to generate tests and fast


ii) Scripting knowledge is optional
iii) It is used to analyze the AUT in terms of object identification.
iv) It is recommended for short term projects.
v) It is recommended for dynamically changing UI designs.

Disadvantages of recording:

i) No centralized maintenance of test objects.

Types of objects in UFT:

In UFT test automation we work with 4 types of objects.

i) Run time objects:


The objects present in the software application
Software objects have different states.
States of software objects:
Enabled state
Disabled state
Visible
Hidden
Focused
ii) Test objects
Reference of run time object is called test object
Test object names vary from one environment to other.
Using object spy we can get object information on test objects.
Object type windows Web vb
Main window Window(“windowname”)
Sub window/popup Dialog(“subwindowname”)
window
Edit/text box Winedit(“editboxname”) Webedit(“editboxname”)
button WinButton(“objectname”) Webbutton(“objectname”)
List/combo box Wincombobox(“listboxname”) Weblist(“listboxname”)
Check box Wincheckbox(“checkboxname”) Webcheckbox(“checkboxname”)
Radio button Winradiobutton(“objectname”) Webradiobutton(“objectname”)
menu Winmenu(“menu”)
browser Browser(“browsername”)
page Page(“pagename”)
frame Frame(“framename”)
table Webtable(“tablename”)
link Link(“linkname”)
image Image(“objectname”)
Web element Webelement(“objectname”)

iii) Utility objects


They are UFT reserved objects used for testing and result reporting.
Ex:

1)Systemutil:

Systemutil is utility object.

Invokeapplication is utility statement. (Only for launching the application)

It is for launching application


a) Windows based application
Syntax:
Systemutil.run “path of the application”
b) Web based application
Syntax:
Systemutil.run”path of the application”,”www.google.coml”

2)Repositoriescollection

3)Environment

4)Services

5)Reporter

iv) Automation objects

Objects Are user defined objects to work with drives, folders.

Object repository:

It is a storage place to store test objects information.

It is an interface between scripts and AUT during run time.

Test object repository AUT

Steps local or shared execution


Two types of object repository in UFT:

a) Local repository
UFT creates a local repository for every action during recording.
Local repository file will be saved along with the test.
Tester can edit local objects
b) Shared object repository (external file)
Extension is .tsr (text shared repository)
User creates shared object repositories either by adding objects or by exporting local objects.
It is external file user has to create and maintain these files.
User can edit shared objects.
i) Add objects:
Open the dialog box or window or web page (AUT)
Select resources menu
Object repository manager
Object menu
Add objects or add objects icon
Show the window
Select option
Click ok button
Save the repository with tsr extension.
4 types of filters:
1) Selected object only ( UFT will store selected object only, no child object)
2) Default object types ( all objects which are having functionality, without static)
3) All object types (all objects including static also means without functionality, any
messages)
4) Selected object types then select which class of object you want

ii) By exporting local objects:


Launch local object repository from resources menu
File menu
Export local object
Enter file name
Create

When to choose add objects feature and when export local object?

When there are few objects available in a window or web page use add objects.

When there are thousands of objects but we want to store few objects that time choose.

Operations on object repository:

1) Add objects (local, shared)


Add objects to local:
Resources menu------object repository-----add objects to local---show the object---ok
Add objects to shared:
Resources menu------object repository manager-----file---open existing .tsr----file--enable
editing—add objects---show the object---ok----save---

2) Rename objects (local, shared)


Object properties can be change. No error will come. Default---name, class, repository
But description properties cannot be changed. It will show error.
Rename local objects:
Resources menu---object repository---select object---right click---rename--close
Rename shared objects:
Resources menu------object repository manager-----file---open existing .tsr----file --enable
editing— select object---right click---rename--save
3) Delete objects (local, shared)
4) Export local objects
Resources menu-object repository---file---export local objects---browse path to store-enter
filename-save
5) Merge repositories:
Resources menu—object repository manager---tools menu---object repository merge tool---
browse path of the primary file—browse path of the secondary file---click ok---shows merge
statistics---close---save the repository with tsr---close repository merge tool—close object
repository manager.

6) Associate shared object repositories or load shared object repository during execution:
Resources menu---associate repositories---click on + symbol---browse the path of the shared
repository—associate –click ok—
Or
Solution explorer---right click on test---associate repository with action.
We can associate multiple actions.
Why we need to associate shared repositories?
In order to create and execute tests manually (without recording).
If it is recording UFT creates local repositories and it uses local object information while test
execution.
If user wants to create tests manually then create shared objects repositories and associate.
Load:
Syntax:
Repositoriescollection.add “path of the shared repository file”

7) Export test objects to XML/ import test object from XML:


We can edit shared objects without UFT tool.
But very limited use in practical.
8) Map objects in between object repository and AUT
How to map?
Using view options in object repository
i) Highlight in application (from OR to AUT)(select object in object repository)
ii) Locate in repository (from AUT to OR)
9) Define new test objects
Using this feature we can create tests even though application is not ready. But not
recommendable feature.
How?
By getting objects information from development team.
Steps:
i) Get objects information from development team
ii) Resources—object---define new test object—select environment---select class of
object—enter name ---

Keyword driven methodology:

Generating tests manually (without recoding) using keywords.

(objects,methods,functions)

Steps:

i) Create shared objects repositories


ii) Associate shared objects repositories or load repositories
iii) Generate steps/statements
1) Using editor view (preferable—expert view)
2) Using keyword view (easy to generate test objects statements quickly)
3) Using step generator (library of functions and utility objects used to generate recordable
and non-recordable steps)
4) By drag and drop objects from Object repositories to UFT editor (test object statements
only)

Step generator: it is a library of functions and utility objects used to generate recordable and non-
recordable steps.

Types of statements in UFT test automation:

You might also like