Native UI Automation methods
Relevant for: GUI tests and components
UFT One UI Automation support provides for a number of native methods accessible with the .Object method. These methods are available for all UI Automation objects.
Each object is assumed to be a collection, even if it is a plain object. This enables UFT One and the .Object method to work with both a single object and a collection.
Note: When using the .Object method, UFT One returns the value "as-is", which can be complex and include several different flags.
See the MSDN reference for the value of these numerical properties. For example, for the State property, see here.
Method | Description |
---|---|
Compare |
Returns an element is equal to the selected object. Syntax . Parameters Element: The element to which to compare the selected element. |
GetElementFromPoint |
Returns an object at the selected coordinates. Syntax
Parameters
|
Filter |
Returns the objects of a collection that meet the requested expression. Syntax
Use static programmatic descriptions to specify an object. For details on static programmatic descriptions, see Static programmatic descriptions. |
Find |
Returns the collection of objects with the requested expression. This method searches objects to the end of object hierarchy, beginning from the object on which the method was called. Syntax
Use static programmatic descriptions to specify an object. For details on static programmatic descriptions, see Static programmatic descriptions. Note: If this method is used from the Desktop object, it searches only the top level windows. |
GetChildren |
Returns a list of all children of the selected object. Syntax
|
GetFirstChild |
Returns the first child object of the selected object. If there are no child objects, UFT One returns a NULL value. Syntax
|
GetFocusedElement |
Returns the currently focused object. Syntax
|
GetLastChild |
Returns the last child object of the selected object. If there are not child objects, UFT One returns a NULL value. Syntax
|
GetNextSibling |
Returns the element which is next in the overall hierarchy to the selected object. Syntax
|
GetParent |
Returns the parent element for a selected object. Syntax
|
GetPreviousSibling |
Returns the element which is prior in the overall hierarchy to the selected object. Syntax
|
GetRootElement |
Returns the Desktop object (which is the root element of all objects in the hierarchy). Syntax
|
Has |
Returns objects that have children with the requested expression. This method searches children to the end of hierarchy. Syntax
Use static programmatic descriptions to specify an object. For details on static programmatic descriptions, see Static programmatic descriptions. |
See also:
- Native properties and operations
- The .Object property in the UFT One Object Model Reference for GUI Testing