UFT Object Identification

Object Identification inward UFT

Search performance using Regular Expression object.

Create Regular Express Object
Using New too RegExp keywords nosotros tin exercise Regular Express Object.

Set variable - New RegExp

Example:

'Count how many times the give-and-take "UFT" appeard inward a text file
Dim objFso, objTextstream, objRegEx, mathces, FileContent
Set objFso = CreateObject("Scripting.FileSystemObject")
Set objTextstream = objFso.OpenTextFile("C:\Users\gcreddy\Desktop\abc.txt")
FileContent = objTextstream.ReadAll

Set objRegEx = New RegExp
objRegEx.Pattern = "UFT"
objRegEx.IgnoreCase = True
objRegEx.Global = True

Set matches = objRegEx.Execute(FileContent)
Msgbox matches.Count
objTextstream.Close
Set objRegEx = Nothing
Set objTextstream = Nothing
Set objFso = Nothing
--------------------------------------------
'Create a Word DocumentDim objWord
Set objWord = CreateObject("Word.Application")
objWord.Visible = True

objWord.Documents.Add
objWord.ActiveDocument.SaveAs "C:\Users\gcreddy\Desktop\xyz.doc"
objWord.Quit
Set objWord = Nothing
---------------------------------------
'Count how many times the give-and-take "UFT" appeard inward a give-and-take documentDim objWord, objDoc, objRegEx, mathces, FileContent
Set objWord = CreateObject("Word.Application")
Set objDoc = objWord.Documents.Open("C:\Users\gcreddy\Desktop\xyz.doc")
FileContent = objDoc.Content

Set objRegEx = New RegExp
objRegEx.Pattern = "UFT"
objRegEx.IgnoreCase = True
objRegEx.Global = True

Set matches = objRegEx.Execute(FileContent)
Msgbox matches.Count
objWord.Quit
Set objRegEx = Nothing
Set objDoc = Nothing
Set objWord = Nothing
-------------------------------------------------
Object Identification Configuration
This Object Identification Configuration is related to Object Repository based Test pattern only.

UFT has default configuration for every Environment.

Ex: Activex, Visual Basic, Web etc...

Object Identification Configuration varies from 1 Environment to another.

> What is Object Identification Configuration?
Configuring objects using about of import properties inward fellowship to recognize them uniquely.

UFT default configuration based on Industry UI pattern standards.

> Why Object Identification Configuration?
For every Object xx to thirty properties data available,  Using that consummate data recognizing objects is fourth dimension taking process, Some objects holding values may alter dynamically throughout the execution,  inward fellowship to solve these ii problems UFT uses about of import properties data to recognize objects.

> When Object Identification Configuration?
Scenario 1:
If nosotros role Descriptive Programming for Test pattern - Not Required.

Scenario 2:If nosotros role Object Repository based Test pattern too developers followed UI pattern standards - Not Required.
(UFT default configuration is Sufficient)

Scenario 3:
If nosotros role Object Repository based Test pattern too developers non followed UI pattern standards-Required.
------------------------------
UFT Object identification Configuration is,

Environment Level (Add in), Ex: Standard Windows

Test Object Class Level, Ex: WinButton

Object Identification Configuration:
Ex: WinButton (Button inward Standard Windows Environment

Normal Identification
    Mandatory properties
        text
        native class
    Assistive Properties
        height
        width

Smart Identification (Optional)
    Base filter Properties
        window id
        x
    Optional filter Properties
        y

Ordinal Identifier
    Index (0, 1, 2, 3....)
    Location (1, 2, 3....)
    CreationTime (0, 1, 2, 3...) (Only for browser object)

Normal Identification Process:

During learning (Recording/Add Objects) UFT commencement reads all mandatory properties at a time, too thinks atmospheric condition that data is sufficient or not?, to recognize the object uniquely.
If it feels sufficient too then it stops learning too stores that information.

Otherwise it goes to Assistive properties too learns properties 1 past times 1 too thinks atmospheric condition that data is sufficient or not? to recognize the object uniquely.
If it feels sufficient too then it stops learning too stores Mandatory too Assistive properties.

After learning all Mandatory too Assistive properties even hence it feels that data is non sufficient too then it goes to Ordinal identifier too learns Index / Location id.

Smart Identification (Normal identification + Smart identification) Process:
---------------------
---------------------------------------
Button (Normal Identification)
-----------
200 buttons

120 buttons - mandatory properties
 20 buttons - mandatory + assistive properties
 60 buttons - Ordinal Identifier

1 - All mandatory properties at a time
2 - Assistive properties 1 past times one(mandatory + Assistive)
3 - Ordinal Identifier

----------------------------------------
Button (Smart Identification (Normal + Smart identification))
-----------
200 buttons

120 buttons - mandatory properties
 20 buttons - mandatory + assistive properties
 40 buttons - smart Identification (base filter properties)
  8 buttons - smart Identification (base filter + optional filter properties)
-----------
  2 buttons - Ordinal identifier

1 - All mandatory properties at a time
2 - Assistive properties 1 past times one
3- All base of operations filter properties at a time
4- Optional filter properties 1 past times one
5 - Ordinal Identifier
-------------------------------------------------   
200 Buttons

100 buttons -default
100 buttons - default non sufficient
Configure the Object class, this configuration is for all 200 buttons.
-------------------------
200 buttons

199 buttons -default
  1 push - default non sufficient

Configure the Object, this configuration is exclusively for that object.
-------------------------------------------
> We tin configure Test object degree or detail object.

> We volition accept dissimilar configurations for Same environment.

3 projects are running using UFT, all projects are spider web only.

We tin hold iii dissimilar configurations for these projects.

1st configure 1st application, generate script too store.

Come dorsum to default configuration.

2nd configure s application, generate script too store.

Come dorsum to default configuration.

3rd configure third application, generate script too store.
-----------------------------
Whenever y'all desire to exercise an execute tests on 1st application too then run 1st application configuration script.
------------------------------------------------

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