UFT Class 35

UFT Class 35

(Object Identification Configuration Part-2, UFT Tool settings configuration, Dictionary Object)

i) How to configure single object?

Open Object Repository

> Select Object

Add Property and Value

ii) How to maintain different configurations for same environment?

3 web Application

Steps:

First Configure Object Identification according to 1st Application

> generate Script and store

> Come back to default configuration and Configure Object Identification according to 2nd Application

> generate Script and store

.
.
————————
Whenever you want to execute tests on 1st application then execute 1st application
Script.
———-
Whenever you want to execute tests on 2nd application then execute 2nd application
Script.
.
.

Tool settings configuration and globalize

i) What is globalizing tool settings?

Providing common configuration for all machines/computers in a project.

ii) Why globalize tool setting?

Since UFT is 1-tier /Stand-alone/desktop application we can’t share settings

iii) How to globalize?

Using “Generate Script” feature we can globalize tool settings.

UFT Tool settings:

i) File menu -> Settings

ii) Tools menu -> Object identification

iii) Tools menu -> Options

Virtual Object Configuration in UFT

Virtual Object Configuration

What is Virtual Object Configuration?

It is a process of making an area or user defined as virtual object.

When we choose Virtual Object Configuration?

Suppose in our AUT, one area is there, UFT is not recognizing that area as object, then we can configure that area as object.

Virtual Object Configuration is related to Recording only.

Navigation for Virtual Object Configuration:

> Tools
> Virtual Object
> Virtual object manager
> Click New > Click Next
>Select Class of Object
>Next > Mark the Object
>Next > Next
> Enter Object name
> Finish
—————————
Ex:
VbWindow(“Form1”).VirtualButton(“Submit”).Click

Dictionary Object

It is used define key, value pairs.

It is equilent to Associated Array in Perl script

VBScript Perl
——————————
Scalar variables Scalar
Array variable Array
Dictionary Object Associate Array/Hash variable
—————————————
What is the difference between Array and Associate Array?

In case of Array Variables user can define values only, keys (indexes) are pre-defined.

In case of Associate Array (in Perl) or Dictionary Object(in VBscript, user can
define key and value pairs.
——————
Array
Dim a(3)

a(0) = 10
a(1) = “India”
a(2) =#10/10/2010#
a(3) = 100

Keys Values
————————
We can use Dictionary items as Global variables

Example:
Dim objDictionary
Set objDictionary = CreateObject(“Scripting.Dictionary”)
‘Defining Key and items
objDictionary.Add 1, 100
objDictionary.Add “Agent”, “Hyderabad”
objDictionary.Add “Password”, “mercury”
objDictionary.Add “AppPath”, “C:\Program Files\HP\Unified Functional Testing\samples\flight\app\flight4a.exe”
objDictionary.Add “*”, “abc”
objDictionary.Add “d”, #10/10/2010#

Msgbox objDictionary.Count ‘6

objDictionary.Remove(1)
Msgbox objDictionary.Count ‘5

Msgbox objDictionary.Exists(“*”) ‘True
Msgbox objDictionary.Exists(“a”) ‘False

objDictionary.RemoveAll
Msgbox objDictionary.Count ‘0

UFT Test Example:

‘Dictionary items as Global Variables
SystemUtil.Run objDictionary(“AppPath”)
Dialog(“Login”).Activate
Dialog(“Login”).WinEdit(“Agent Name:”).Set objDictionary(“Agent”)
Dialog(“Login”).WinEdit(“Password:”).Set objDictionary(“Password”)
wait 2
Dialog(“Login”).WinButton(“OK”).Click
———————————————-

Follow me on social media: