UFT Tutorial 35


UFT Class 35 (Object Identification Configuration Part-2, UFT Tool settings configuration, Dictionary Object)
i) How to configure unmarried object?
Open Object Repository

> Select Object

> Add Property too Value
---------------------------------
ii) How to keep dissimilar configurations for same environment?
3 spider web Application

Steps:

First Configure Object Identification according to 1st Application

> generate Script too store

> Come dorsum to default configuration too Configure Object Identification according to sec Application

> generate Script too store

.
.
------------------------
Whenever yous desire to execute tests on 1st application too thus execute 1st application
Script.
----------
Whenever yous desire to execute tests on sec application too thus execute sec application
Script.
.
.
-------------------------------------------
Tool settings configuration too globalize

i) What is globalizing tool settings?
Providing mutual configuration for all machines/computers inward a project.
-----------------------------------
ii) Why globalize tool setting?
Since UFT is 1-tier /Stand-alone/desktop application nosotros can't percentage settings
-------------------------------------------------------------
iii) How to globalize?
Using "Generate Script" characteristic nosotros tin forcefulness out globalize tool settings.
---------------------------------------------
UFT Tool settings:
i) File bill of fare -> Settings

ii) Tools bill of fare -> Object identification

iii) Tools bill of fare -> Options
---------------------------------------------------
Virtual Object Configuration
 

What is Virtual Object Configuration?
It is a procedure of making an surface area or user defined every bit virtual object.

When nosotros select Virtual Object Configuration?
Suppose inward our AUT, i surface area is there, UFT is non recognizing that surface area every bit object, too thus nosotros tin forcefulness out configure that surface area every bit 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 inward Perl script

VBScript        Perl
------------------------------
Scalar variables    Scalar
Array variable        Array
Dictionary Object    Associate Array/Hash variable
---------------------------------------
What is the divergence betwixt Array too Associate Array?

In instance of Array Variables user tin forcefulness out define values only, keys (indexes) are pre-defined.

In instance of Associate Array (in Perl) or Dictionary Object(in VBscript, user can
define primal too value pairs.
------------------
Array
Dim a(3)

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

Keys Values
------------------------
We tin forcefulness out purpose Dictionary items every bit Global variables

Example: 

Dim objDictionary
Set objDictionary = CreateObject("Scripting.Dictionary")
'Defining Key too 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 every bit 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
----------------------------------------------

Sumber http://www.gcreddy.com/
Post a Comment (0)
Previous Post Next Post