Skip to content

UIAObject

UIAutomation UIAObject.

Extends SeSSimulatedObject

Behavior Pattern: UIAObjectGenericBehavior

Property Summary

Property Description Getter Setter
AutomationId Automation ID of UI Automation object GetAutomationId
ChildAt Object for nth child of this object's UI Automation node GetChildAt
ChildrenCount Number of UI Automation nodes within current node GetChildrenCount
Height Height of the object. GetHeight
IndexInParent Object's order index in parent UI Automation node GetIndexInParent
Name Name of of UI Automation object GetName
NextSibling Object for UI Automation next sibling node GetNextSibling
Parent Object for UI Automation parent node GetParent
PrevSibling Object for UI Automation previous sibling node GetPrevSibling
TypeName Type name of UI Automation object GetTypeName
Value Value of the object. GetValue
Visible Returns true if the element is visible, otherwise - false. GetVisible
Width Width of the object. GetWidth
X X-coordinate of the top left corner of the object. GetX
Y Y-coordinate of the top left corner of the object. GetY

Action Summary

Action Description
DoClick Performs left click at the center of an object.
DoDumpWidget Dumps Spy data for the object.
DoFindByLocation Finds nested element by its location string.
DoFindByText Find nested element by its text (Value and Name of each element are compared with specified text or regular expression).
DoFindElementByCondition Finds first element matching the condition.
DoFindElementsByCondition Finds all elements matching the condition
DoGetWidgetProperty Returns the value of a property with a given name.

Property Detail

AutomationId

Automation ID of UI Automation object

Type: string

Accessors: GetAutomationId

value = SeS('SomeUIAObject').GetAutomationId()

ChildAt

Object for nth child of this object's UI Automation node

Getter Parameters:

Name Type Description
ind number Zero-based index for a required child

Type: UIAObject

Accessors: GetChildAt

value = SeS('SomeUIAObject').GetChildAt(ind)

ChildrenCount

Number of UI Automation nodes within current node

Type: number

Accessors: GetChildrenCount

value = SeS('SomeUIAObject').GetChildrenCount()

Height

Height of the object.

Type: number

Accessors: GetHeight

value = SeS('SomeUIAObject').GetHeight()

IndexInParent

Object's order index in parent UI Automation node

Type: number

Accessors: GetIndexInParent

value = SeS('SomeUIAObject').GetIndexInParent()

Name

Name of of UI Automation object

Type: string

Accessors: GetName

value = SeS('SomeUIAObject').GetName()

NextSibling

Object for UI Automation next sibling node

Type: UIAObject

Accessors: GetNextSibling

value = SeS('SomeUIAObject').GetNextSibling()

Parent

Object for UI Automation parent node

Type: UIAObject

Accessors: GetParent

value = SeS('SomeUIAObject').GetParent()

PrevSibling

Object for UI Automation previous sibling node

Type: UIAObject

Accessors: GetPrevSibling

value = SeS('SomeUIAObject').GetPrevSibling()

TypeName

Type name of UI Automation object

Type: String

Accessors: GetTypeName

value = SeS('SomeUIAObject').GetTypeName()

Value

Value of the object.

Type: number

Accessors: GetValue

value = SeS('SomeUIAObject').GetValue()

Visible

Returns true if the element is visible, otherwise - false. Requires Rapise 6.6+

Type: boolean

Accessors: GetVisible

value = SeS('SomeUIAObject').GetVisible()

Width

Width of the object.

Type: number

Accessors: GetWidth

value = SeS('SomeUIAObject').GetWidth()

X

X-coordinate of the top left corner of the object.

Type: number

Accessors: GetX

value = SeS('SomeUIAObject').GetX()

Y

Y-coordinate of the top left corner of the object.

Type: number

Accessors: GetY

value = SeS('SomeUIAObject').GetY()

Action Detail

DoClick

Performs left click at the center of an object. It is a customizable variant of LClick action.

SeS('SomeUIAObject').DoClick(x, y)

Parameters:

Name Type Description
x number X offset to click within object. Calculated from the top-left corner. Default is a center. Floating point in the range (-2, 2) means percentage of the width.
Optional.
y number Y offset to click within object. Calculated from the top-left corner. Default is a center. Floating point in the range (-2, 2) means percentage of the height.
Optional.

DoDumpWidget

Dumps Spy data for the object.

SeS('SomeUIAObject').DoDumpWidget(dumpProperties, maxDepth, trimValue, indent, filePath, append, ignoreProps)

Parameters:

Name Type Description
dumpProperties boolean If 'true' then includes properties to the result.
Optional, Default: "false".
maxDepth number Determines max recursion depth. If '0' then dumps current object only, if '1' - dumps direct children as well, etc. If '-1' then dumps the whole subtree of objects.
Optional, Default: "0".
trimValue number Determines maximum length of a property value. Excess characters are truncated.
Optional, Default: "256".
indent string Indentation string for child objects and properties.
Optional, Default: "\".
filePath string If 'filePath' is set then outputs result to corresponding file.
Optional, Default: "".
append boolean If 'true' then file should be overwritten, if 'false' then data should be appended.
Optional, Default: "false".
ignoreProps Array Contains the names of the properties which must be ignored when writing into a file.
Optional, Default: "undefined".

Returns:

string |
boolean: Object data if 'filePath' is not set, 'true' if file write succeeded, 'false' - otherwise.

DoFindByLocation

Finds nested element by its location string. Supports /Id, .. (up) and (any), i.e. ../[3]/Button[1] - go to parent, then 4th child, then find 2nd button. Requires Rapise 8.1+.

SeS('SomeUIAObject').DoFindByLocation(strLocation)

Parameters:

Name Type Description
strLocation string Relative location of element.

Returns:

UIAObject: UIAObject if found, null otherwise

DoFindByText

Find nested element by its text (Value and Name of each element are compared with specified text or regular expression).

SeS('SomeUIAObject').DoFindByText(textOrRegexp, depth)

Parameters:

Name Type Description
textOrRegexp string plain string or regexp:... expression to match
depth number depth level for search (default is 3)
Optional, Default: "3".

Returns:

UIAObject: UIAObject containing text if found, null otherwise

DoFindElementByCondition

Finds first element matching the condition. Requires Rapise 6.6+

SeS('SomeUIAObject').DoFindElementByCondition(scope, condition)

Parameters:

Name Type Description
scope string Scope for element search. Possible values: "Element", "Children", "Descendants", "Subtree", "Parent", "Ancestors"
condition expression UIAutomation2 locator or condition object.

Returns:

UIAObject: UIAObject if the element is found, null otherwise

DoFindElementsByCondition

Finds all elements matching the condition

SeS('SomeUIAObject').DoFindElementsByCondition(scope, condition)

Parameters:

Name Type Description
scope string Scope for element search. Possible values: "Element", "Children", "Descendants", "Subtree", "Parent", "Ancestors"
condition expression UIAutomation2 locator or condition object.

Returns:

Array: Array of UIAObjects for the found elements, the array is empty if nothing is found. Requires Rapise 6.6+

DoGetWidgetProperty

Returns the value of a property with a given name. Names of available properties can be seen in Spy.

SeS('SomeUIAObject').DoGetWidgetProperty(name)

Parameters:

Name Type Description
name string Property name.

Returns:

string: Property value if successful, an empty string if the property can not be found.