Sample Generated Automation Script for Object Identification

Relevant for: GUI tests and components

The UFT One Automation script below shows selected excerpts from a script that was generated using the Generate Script button in the Object Identification dialog box. The script was generated with the Web Add-in loaded.

Dim App 'As Application
Set App = CreateObject("QuickTest.Application")
App.Launch
App.Visible = True
'Configuration of user-defined objects
'Object identification configuration for user-defined object "abtobjectgraphicswidget"
App.Options.ObjectIdentification("WinObject").CreateUserDefinedObject("abtobjectgraphicswidget")
App.Options.ObjectIdentification("abtobjectgraphicswidget").OrdinalIdentifier = "location"
App.Options.ObjectIdentification("abtobjectgraphicswidget").MandatoryProperties.RemoveAll()
App.Options.ObjectIdentification("abtobjectgraphicswidget").MandatoryProperties.Add("regexpwndclass")
App.Options.ObjectIdentification("abtobjectgraphicswidget").MandatoryProperties.Add("va_name")
App.Options.ObjectIdentification("abtobjectgraphicswidget").AssistiveProperties.RemoveAll()
App.Options.ObjectIdentification("abtobjectgraphicswidget").AssistiveProperties.Add("text")
App.Options.ObjectIdentification("abtobjectgraphicswidget").AssistiveProperties.Add("attached text")
App.Options.ObjectIdentification("abtobjectgraphicswidget").AssistiveProperties.Add("window id")
App.Options.ObjectIdentification("abtobjectgraphicswidget").AssistiveProperties.Add("nativeclass")
App.Options.ObjectIdentification("abtobjectgraphicswidget").AssistiveProperties.Add("object class")
App.Options.ObjectIdentification("abtobjectgraphicswidget").EnableSmartIdentification = False
App.Options.ObjectIdentification("abtobjectgraphicswidget").BaseFilterProperties.RemoveAll()
App.Options.ObjectIdentification("abtobjectgraphicswidget").OptionalFilterProperties.RemoveAll()
'Configuration of Standard Windows objects
'Object identification configuration for test object "winmenu"
App.Options.ObjectIdentification("winmenu").AvailableProperties.Add("menuobjtype")
App.Options.ObjectIdentification("winmenu").MandatoryProperties.RemoveAll()
App.Options.ObjectIdentification("winmenu").MandatoryProperties.Add("menuobjtype")
App.Options.ObjectIdentification("winmenu").AssistiveProperties.RemoveAll()
App.Options.ObjectIdentification("winmenu").EnableSmartIdentification = False
App.Options.ObjectIdentification("winmenu").BaseFilterProperties.RemoveAll()
App.Options.ObjectIdentification("winmenu").OptionalFilterProperties.RemoveAll()
'Configuration of Web objects
'Object identification configuration for test object "page"
App.Options.ObjectIdentification("page").AvailableProperties.Add("abs_x")
App.Options.ObjectIdentification("page").AvailableProperties.Add("abs_y")
App.Options.ObjectIdentification("page").AvailableProperties.Add("height")
App.Options.ObjectIdentification("page").AvailableProperties.Add("hwnd")
App.Options.ObjectIdentification("page").AvailableProperties.Add("name")
App.Options.ObjectIdentification("page").AvailableProperties.Add("title")
App.Options.ObjectIdentification("page").AvailableProperties.Add("url")
App.Options.ObjectIdentification("page").AvailableProperties.Add("width")
App.Options.ObjectIdentification("page").MandatoryProperties.RemoveAll()
App.Options.ObjectIdentification("page").AssistiveProperties.RemoveAll()
App.Options.ObjectIdentification("page").EnableSmartIdentification = True
App.Options.ObjectIdentification("page").BaseFilterProperties.RemoveAll()
App.Options.ObjectIdentification("page").OptionalFilterProperties.RemoveAll()
App.Options.ObjectIdentification("page").OptionalFilterProperties.Add("title")
App.Options.ObjectIdentification("page").OptionalFilterProperties.Add("url")