UFT Class 3

UFT Class 3: UFT Test Process Part-2

( UFT Test Process Part -2, UFT Tool window Architecture Part-1)

12) Using Automation Objects (VBScript)

a) File System Object

It is used to work with Drives, Folders and files.

i) What is Computer File system?

It is a feature of Operating system used to work with Drives, Folders and files.

ii) Examples for File system Operations

Create a Folder

Copy a Folder

Delete a Folder

Create a Text file

Write data

Read data

Compare data

Search operations

Delete a text file etc…

iii) How end user performs File system Operations?

End user performs file system operations manually with the help of Input devices

If it is command line OS (Ex: DOS, UNIX) with help of OS Commands

iv) How to perform automatic File system Operations using VbScript?

Using File system object

Syntax for Creating Automation Object:

Set Variable = CreateObject(“Class Value”)

Set -VBScript statement

CreateObject – Built in function of VBScript

Create File System Object:

Set Variable = CreateObject(“Scripting.FileSystemObject”)

Note: It is only for flat files, but we can create and delete other types files also.

File system object treats them as flat files only.
b) Excel Application Object

It is used to perform operations on Excel Application

Create Excel file

Row count

Read data

Write data

Compare data

Rename sheets

Add sheets

Move sheets etc…

Create Excel Application Object

Set Variable = CreateObject(“Excel.Application”)
c) Word Application object

It is used to perform operations on word application

Create Word Application Object

Set Variable = CreateObject(“Word.Application”)
d) Database Objects

1) Database Connection object

It is used to connect to a Database (Any Database)

Note: Connection string varies from one database to another.

Create Database Connection object:

Set Variable = CreateObject(“Adodb.Connection”)
2) Database Recordset object

It is used to perform operations on Database records (Tables)

Create Database Recordset object:

Set Variable = CreateObject(“Adodb.Recordset”)
e) Dictionary object

Dim a(3), b
a(0) = 10
a(1) = 20

It is used to define key, value pairs

Create Dictionary Object

Set Variable = CreateObject(“Scripting.Dictionary”)
13) Error Handling

Handling expected and unexpected errors

Expected error:

Whenever we use invalid input, then expected errors

Note: We use Invalid input for negative testing

Unexpected Error:

Availability of Resource

Insufficient Resource

Resource Response

UFT Tool Window Architecture

IV) Running (Executing) and Debugging Tests

Debugging is optional but when it is required?

Test is not showing any errors and providing correct output – Not required

Test is showing errors -Optional

Test is not showing any errors and Not providing correct output -Yes

Using VBScript Debug commands and Breakpoints we can debug tests.

Test Run

Single Test Run – Using Run Command

Batch Testing
Using “Test Batch Runner Tool”
Using AOM Script (QTP Application Object)
Using Driver Script (UFT Test)
Using ALM/QC Tool

V) Analyzing Test Results

Test Result for every Test Iteration

Status of Test Result:

Pass (If expected = Actual)
Fail (If expected <> Actual)
Done (Test executed without errors)
(* There are no verification in our test then done status)
Warning (Problems during Test Execution

Define Test Results

UFT Provides Test result for every test iteration if we use UFT
Tool features like checkpoints, output values and transaction points etc…

If user uses own logic (VBScript features) the user need to define test result.

VI) Reporting Defects

Functional Test Automation Defect Management
UFT Manual (Excel sheet…)
UFT Bugzilla, Jira etc…
UFT Test Process
I) Test Planning
II) Generating Basic Tests
III) Enhancing Tests
IV) Running and Debugging Tests
V) Analyzing Test Results
VI) Reporting Defects.

UFT Tool window Architecture

Add in Manager:

During launching UFT shows Add in Manager,
It shows all available Add ins in our company,
Select appropriate add in for our Application,

Note: Do not select unnecessary Add ins, then Tool execution performance will be reduced.

Test Tool AUT
Launch UFT Tool first then AUT,

Note: If we launch AUT first, then UFT may not recognize Application objects.

UFT Tool Editor:

It is an area where we Create/View/Edit a Test or Test Script.
Using UFT Tool editor we can delete one or more statements.

Note: UFT Test is a file, you can delete UFT test file from Hard disk.

It has 2 views
Editor view – Test in VBScript format
Keyword view – Test in GUI format

View are different, but Test is same.

If we perform any modification in one view that automatically reflects in another view.

Switch from Editor to Keyword view:

View menu -> Keyword view

Switch from Keyword view to Editor:

View menu-> Editor

UFT Test / Test Script

Test – One or more Actions to perform a task or tasks

Action – Set of statements to perform a task or tasks

Statement / Step / Instruction – a minimal executable unit

Note: One test may have one or more Actions, if it is simple test use single Action
for lengthy test use multiple Actions.

For re-usability we prefer multiple Actions.

Statement Line

One statement may have one or more lines and vice versa.

Two statements in single line

Msgbox “Hello UFT” : Msgbox “Hello VBScript”

One Statement in Two Lines

Msgbox _
“Hello UFT”

Active Screen:

Launch Active Screen

View menu-> Active Screen

It captures and holds screen shot for every user operation on AUT.


Using Active screen we can easily understand and Edit Tests


It occupies more memory, reduces Tool execution performance.

Configure Active Screen:

Tools menu-> Options -> GUI Testing ->Active Screen-> Increase/Decrease Capture Level->Ok
Note: This feature is related to Recording only.


You may also like...

Leave a Reply