9/7/14

Types of Objects in UFT Test Automation

Basically UFT is object based Test Tool, based on Front-end objects only it performs Test operations. So we need to femilar with Software Objects.

Note: For Database Testing no object reference is required, uft has an integrated SQL Engine, we can execute SQL commands directly in the UFT Tool Editor.


Software Objects in Windows based Environment:

Window, Dialog Box, Button, Radio Button, Check box, edit box, List box, Drop-down box, Combo box Etc…


Software Objects in Web based Environment:

Browser, Page, Link, Image, Grid, Button, Radio Button, Check box, edit box, List box, Drop-down box, Combo box Etc…


Note: Some objects are common in both the environments, ex: Button, edit box, List box etc…


What is Object?


It is some thing which has structure and Properties.


What is Property?

It is an attribute of the Object, which describes the object.


What is Method?

It is an Operation on the Object


In Test Automation Using UFT, we user 4 Types of Objects,

i) Run-time Objects


ii) Test Objects


iii) Utility Objects


iv) Automation Objects


i) Run-time Objects

Objects present in the Application


Ex: Buttons, Links, edit boxexs etc…


Note: Irrecptive of the environment (Ex: Java or .NET or Web) end user calls Button is Button, Edit box is Edit box, Check box is Check box(If it is Java or .NET or any environment)


States of Run-time Objects:


Enabled, Disabled, Visible, Hidden, Focused


ii) Test Objects

Reference of Run-time object ia called Test Object.


Test object name varies from one environment to another


Example:

Object        Windows        Visual Basic    Web
--------------------------------------------------------------------------------------------------
Button        WinButton    VbButton    WebButton

Edit box      WinEdit        VbEdit        WebEdit


Browser      NA               NA             Browser


Page          NA               NA               Page

--------------------------------------------------------------------------------------------

How to get Test Object Information


    Using Object Spy


    Using Object Identification


States of Test Object

Constant Object : Whose properties values are fixed


Dynamic Object:  Whose properties values change dynamically throughout the execution


Duplicate Objects: Two are more objects with same description


iii) Utility Objects

They are UFT Reserved Objects used for Testing and Result Reporting


Every Utility object is unique,

Ex:

SystemUtil Object is Used to launch the Application.


Syntax:


SystemUtil.Run "Path of the Application" - windows based Application

SystemUtil.Run "Path of the Browser", "url" -Web based Application

Ex:


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

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

iv) Automation Objects

They are User defined Objects used to work with Drives, Folders, Databases and Files.


a) File System Object Model

It is used to work with Drives, Folders and Files (Flat files)


Class value: ("Scripting.FileSystemObject")


How to create File System Object?


Set Variable = CreateObject(“Scripting.FileSystemObject”)


b) Excel Application Object

It is used to work with Excel Application/Excel files


Class value: ("Excel.Application")


c) Word Application Object

It is used to work with Word Application / Word documents


Class Value: ("Word.Application")


d) Database Objects

1) Database Connection Object


It is used to connect to Databases


Class value: ("Adodb.Connection")


2) Database Recordset object


It is used to perform operations on Database Tables


Class value: ("Adodb.Recordset")


e) Dictionary Object

It is used to define Key, Value pairs


Class value: ("Scripting.Dictionary")


f) QTP Application Object

It is used to automate UFT Tool operations and it is Local object model


Class Value: ("QuickTest.Application")




0 comments:

Post a Comment