UFT Test Process Part 2

UFT Test Process Part 2 , Types of Objects in UFT , Types of Statements in UFT Test
c) Word Application Object

It is used to perform word application operations

Class value for creating Word Application Object- (“Word.Application”)
d) Database Connection Object

It is used to connect to Databases

Note: Connection string only varies from one Database to another

Class value for creating Database Connection Object- ("Adodb.Connection")
e) Database Recordset object

It is used to perform operations on Database Tables

 Class value for creating Database Recordset Object- ("Adodb.Recordset")
f) Dictionary object

It is used to define Key, Value Pairs.

Class value for creating Dictionary Object- ("Scripting.Dictionary")
14) Error Handling (VBScript, UFT)

Handling expected and unexpected Errors

Expected Error: Whenever we use invalid input then we can expect errors

Scenarios for Unexpected Errors:
Resource Response
Availability of Resource
Insufficient Resource

    Using Conditional statements
    Using Built -in functions
    Using Option explicit statement
    Using On Error Resume Next
    Using Exit Statement
    Recovery Scenarios (UFT)
4th Phase of UFT Test Process
IV) Running and Debugging Tests

Running Tests:

    Step by Step (Using Debug Commands)
    Single Test Run (Using Run Command)
    Batch Testing
        Using "Test Batch Runner" Tool
        Using AOM Script ("QuickTest.Application")
        Using Driver Script
        Using ALM Tool
Debugging Tests:

What is debugging?
When debugging is required?
    Test is not showing any errors and Not providing correct output then Debugging is required.

x = a * b

How to debug?
Using vbscript debug commands and breakpoints

Important Debug Commands
Step into (F11)
Step Over (F10)
Step Out (Shift + F11)
Breakpoint (F9)
5th Phase of UFT Test Process
V) Analyzing Test Result

UFT Result Window

UFT Provides Test Result for every Test iteration if we use UFT Tool features like Checkpoints, Output values, Transaction points etc…

Define Test Result

If we use our own login then we need to define Test Result

Using Reporter Utility Object we can define Test Result

Dim a, b
a = 100
b = 50

If a > b Then
    Reporter.ReportEvent micPass, "Res1", "A is a Big Number"
    Reporter.ReportEvent micFail, "Res1", "B is a Big Number"
End If-------------------

Status of Test Result:
(If Expected = Actual)

(If Expected <> Actual)

No Verification points, Test executing without Errors

Interruption during Test Execution.
6th Phase of UFT Test Process
VI) Reporting Defects
Functional Test Automation        Defect Management
UFT                    Manual
UFT                    Bugzilla/Jira
UFT                    ALM
Note: By integrating UFT with ALM, we can send defects directly from UFT Result window to ALM Project.
Types of Objects in UFT Test Automation
We work with Four types of objects in UFT Test Automation

1) Run-time Objects

The Objects that present in the Application are called Run-time Objects

States of Run-time objects:

    Enabled Objects
    Disabled Objects
    Focused Objects
    Hidden Objects
    Visible Objects
b) Test Objects

Reference of Run-time objects are called Test Objects
    Constant Objects
    Dynamic Objects (handle using Regular Expressions)
    Duplicate Objects (Using Index property)

Run-Time Object        windows        VB        Web
Button            WinButton    VbButton    WebButton

Edit box        WinEdit        VbEdit        WebEdit

Browser            NA        NA        Browser

Page            NA        NA        Page

Link            NA        NA        Link
c) Utility Objects

UFT reserved objects used for Testing and Result Reporting.



Windows based App

SystemUtil.Run "Path of the AUT"

Web based App

SystemUtil.Run "Path of the Browser", "URL"


SystemUtil.Run "C:\Program Files\HP\Unified Functional Testing\samples\flight\app\flight4a.exe"

SystemUtil.Run "C:\Program Files\Internet Explorer\iexplore.exe", "www.google.com"
d) Automation objects

File System Object

Excel Application Object

Word Application Object

Database Connection Object

Database Recordset Object

Dictionary Object
Types of Statements in UFT Test / Test Script

1) Object Calls / Test Object Statements


Single Test Object


TestObject("ObjectName").Method / Operation


Two Test Objects


Parent TestObject("ObjectName").Child TestObject("ObjectName").Method


Three Test Objects

Parent TestObject("ObjectName").Child TestObject("ObjectName").Sub Chid TestObject("ObjectName").Method

 Browser("MSN India - News, Cricket,").Page("Google").Link("Gmail").Click

2) Utility Statements
SystemUtil.Run "C:\Program Files\HP\Unified Functional Testing\samples\flight_service\HPFlights_Service.exe" @@ hightlight id_;_Browser("MSN India - News, Cricket,").Page("Google").Link("Gmail")_;_script infofile_;_ZIP::ssf6.xml_;_

SystemUtil.Run "C:\Program Files\Internet Explorer\iexplore.exe", "www.gmail.com"

3) Declarations
a) Variables

Dim a, b(4), c(), d(4, 5)

a= 10
b(0) = "India"
b(1) =100
b(2) =10.345
b(3) =#10/10/2010#
b(4) =123

d(0, 0) = "VBScript"

b) Constants

Const city ="London", num = 100

4) Flow Control Statements
a) Conditional Statements


Dim a, b
a= 100
b= 20

If a > b Then
    Msgbox "A is a Big Number"
    Msgbox "B is a Big Number"
End If
b) Loop Statements

For i = 1 To 5 Step 1
    Msgbox i & " Hello UFT"

5) Action Calls, Function Calls

Call Login()

6) Checkpoint Statements
Window("Flight Reservation").WinEdit("Tickets:").Check CheckPoint("Tickets:")

7) Output Value Statements
Window("Flight Reservation").WinEdit("Name:").Output CheckPoint("Name:")

8) VBScript Statements





9) Automation Objects Statements
objExcel.Visible = True
objExcel.ActiveWorkbook.SaveAs "C:\Users\gcreddy\Desktop\QTP.xls"


Post a Comment