Skip to content

JavaObject

Standard Java (AWT, Swing) Object.

UI element class: regex:.*

Extends SeSSimulatedObject

Behavior Pattern: JavaObjectGenericBehavior

Property Summary

Property Description Getter Setter
ControlType Type of the object. GetControlType
Enabled 'Enabled' state of the element. GetEnabled
Height Height of the object. GetHeight
Parent Object for UI Automation parent node GetParent
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
DoAction Clicks in the middle of the control.
DoDumpWidget Dumps Spy data for the object.
DoFindByLabel Find nested element by its label (getLabel() property of each element is compared with specified text or regular expression).
DoFindByName Find nested element by its name (getName() property of each element is compared with specified text or regular expression).
DoFindByText Find nested element by its text (getText() property of each element is 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

ControlType

Type of the object.

Type: string

Accessors: GetControlType

value = SeS('SomeJavaObject').GetControlType()

Enabled

'Enabled' state of the element.

Type: boolean

Accessors: GetEnabled

value = SeS('SomeJavaObject').GetEnabled()

Height

Height of the object.

Type: number

Accessors: GetHeight

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

Parent

Object for UI Automation parent node

Type: UIAObject

Accessors: GetParent

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

Width

Width of the object.

Type: number

Accessors: GetWidth

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

X

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

Type: number

Accessors: GetX

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

Y

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

Type: number

Accessors: GetY

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

Action Detail

DoAction

Clicks in the middle of the control.

SeS('SomeJavaObject').DoAction()

Returns:

boolean: 'true' if success, 'false' otherwise.

DoDumpWidget

Dumps Spy data for the object.

SeS('SomeJavaObject').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.

DoFindByLabel

Find nested element by its label (getLabel() property of each element is compared with specified text or regular expression).

SeS('SomeJavaObject').DoFindByLabel(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:

JavaObject: JavaObject containing text if found, null otherwise

DoFindByName

Find nested element by its name (getName() property of each element is compared with specified text or regular expression).

SeS('SomeJavaObject').DoFindByName(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:

JavaObject: JavaObject containing text if found, null otherwise

DoFindByText

Find nested element by its text (getText() property of each element is compared with specified text or regular expression).

SeS('SomeJavaObject').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:

JavaObject: JavaObject containing text if found, null otherwise

DoFindElementByCondition

Finds first element matching the condition.

SeS('SomeJavaObject').DoFindElementByCondition(condition)

Parameters:

Name Type Description
condition expression Object in a form {propname1:propvalue1, propname2:propregexp2,...}. I.e.: {'text':'regex:Enter .*'}

Returns:

JavaObject: JavaObject if the element is found, null otherwise

DoFindElementsByCondition

Finds all elements matching the condition

SeS('SomeJavaObject').DoFindElementsByCondition(condition)

Parameters:

Name Type Description
condition expression Object in a form {propname1:propvalue1, propname2:propregexp2,...}. I.e.: {'text':'regex:Enter .*'}

Returns:

Array: Array of JavaObjects for the found elements, the array is empty if nothing is found.

DoGetWidgetProperty

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

SeS('SomeJavaObject').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.