UiObjectTO
Java. UiObjectTO
Constructor
new UiObjectTO()
Members
displayName
Methods
$(description) → {*}
Parameters:
Name | Type | Description |
---|---|---|
description | Description | The description of the test object. Can be a full test object description or a string. If a string is provided, it is interpreted as a CSS selector with a default test object type of WebElement. |
Returns:
- Type
- *
$$(description, dontFilterByTypeopt) → {Promise.<Array.<TestObject>>}
Parameters:
Name | Type | Attributes | Default | Description |
---|---|---|---|---|
description | A description object that defines the test object type and the set of properties and values that should be common to all objects that are returned. | |||
dontFilterByType | boolean |
<optional> | false | Set this parameter to true to avoid limiting the returned objects to a specific test object type. |
Returns:
- Type
- Promise.<Array.<TestObject>>
absoluteLocation() → {Promise.<Point>}
Remark: 0,0 is always the top-left corner of the (primary) monitor.
Returns:
- Type
- Promise.<Point>
attachedText() → {Promise.<string>}
Returns:
- Type
- Promise.<string>
backgroundColor() → {Promise.<string>}
Returns:
- Type
- Promise.<string>
click(argsopt) → {Promise.<void>}
Parameters:
Name | Type | Attributes | Description | |||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
args | Object |
<optional> | The arguments for the click operation.
Properties
|
Returns:
- Type
- Promise.<void>
createObject(className, …argsopt) → {Promise.<Object>}
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
className | string | The java class name. | |
args | Object |
<optional> <repeatable> | Any arguments required for the object's constructor. |
Returns:
a promise that is fulfilled with a native object wrapping an instance of a Java object within your application.
- Type
- Promise.<Object>
description() → {*}
Returns:
- Type
- *
doubleClick(argsopt) → {Promise.<void>}
Parameters:
Name | Type | Attributes | Description | |||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
args | Object |
<optional> | The arguments for the double-click operation.
Properties
|
Returns:
- Type
- Promise.<void>
exists(timeoutopt) → {Promise.<boolean>}
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
timeout | number |
<optional> | The time (in seconds) to wait for this object before returning a result of true or false. By default, uses the object synchronization timeout defined in the runtime engine settings. |
Returns:
- Type
- Promise.<boolean>
fireEvent(eventInfo) → {Promise.<void>}
Important: This method is not supported for SWT controls.
Parameters:
Name | Type | Description |
---|---|---|
eventInfo | Java.UiEventInfo | Java.MouseEventInfo | Java.KeyboardEventInfo | The event info describing the event to trigger. |
Returns:
- Type
- Promise.<void>
fireEventByClass(className, eventId, …eventArgsopt) → {Promise.<void>}
Important: This method is not supported for SWT controls.
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
className | string | The name of the Java class representing the event to be activated. | |
eventId | string | The event ID number or the final field string that represents the event ID. | |
eventArgs | string | boolean | number |
<optional> <repeatable> | Any parameters of the event's constructor except the source and EventID. |
Returns:
- Type
- Promise.<void>
foregroundColor() → {Promise.<string>}
Returns:
- Type
- Promise.<string>
getObjectProperty(propName) → {Promise.<object>}
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
propName | string |
<optional> | The name of the property. |
Returns:
- Type
- Promise.<object>
getStatics(className) → {Promise.<Object>}
Parameters:
Name | Type | Description |
---|---|---|
className | string | The java class name whose static members you want to access. |
Returns:
a promise that is fulfilled with a native object wrapping a Java class capable of accessing static members within your application.
- Type
- Promise.<Object>
getTextLocations(text, rectangleopt) → {Promise.<Object>}
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
text | string | The text to search for in the test object. | |
rectangle | Object |
<optional> | The rectangular area in the test object to search for the text. |
Returns:
- Type
- Promise.<Object>
getVisibleText(rectangleopt) → {Promise.<string>}
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
rectangle | Object |
<optional> | The rectangular area in the test object to return the text from. |
Returns:
- Type
- Promise.<string>
highlight() → {Promise.<void>}
Remark: This may be useful when debugging a test.
Returns:
- Type
- Promise.<void>
highlightMatches(description, dontFilterByTypeopt) → {Promise.<number>}
Parameters:
Name | Type | Attributes | Default | Description |
---|---|---|---|---|
description | A description object that defines the test object type and the set of properties and values that should be common to all objects that are highlighted. | |||
dontFilterByType | boolean |
<optional> | false | Set this parameter to true to avoid limiting the highlighted objects to a specific test object type. |
Returns:
- Type
- Promise.<number>
isEnabled() → {Promise.<boolean>}
Returns:
- Type
- Promise.<boolean>
isFocused() → {Promise.<boolean>}
Returns:
- Type
- Promise.<boolean>
isVisible() → {Promise.<boolean>}
Check if the object is visible.
Returns:
a promise that is fulfilled with a boolean value indicating if the object is visible or not.
- Type
- Promise.<boolean>
isWrapped() → {Promise.<boolean>}
Check if the object is wrapped.
E.g.: If an edit field is part of an editable combobox, then the edit field is wrapped inside the combobox.
Returns:
a promise that is fulfilled with a boolean value indicating if the object is wrapped or not.
- Type
- Promise.<boolean>
label() → {Promise.<string>}
Returns:
- Type
- Promise.<string>
location() → {Promise.<Point>}
Returns:
- Type
- Promise.<Point>
nativeClass() → {Promise.<string>}
Returns:
- Type
- Promise.<string>
nativeObject() → {Promise.<Object>}
Returns:
- Type
- Promise.<Object>
objectName() → {Promise.<string>}
Returns:
- Type
- Promise.<string>
parent() → {*}
Returns:
- Type
- *
path() → {Promise.<string>}
Returns:
- Type
- Promise.<string>
sendKeys(inputopt, modifiersopt) → {Promise.<void>}
Parameters:
Name | Type | Attributes | Default | Description |
---|---|---|---|---|
input | string |
<optional> | The string to send to the object. Use Keys for special keys. | |
modifiers | KeyModifier |
<optional> | KeyModifier.none | The modifier keys. Use KeyModifier for this parameter. |
Returns:
- Type
- Promise.<void>
size() → {Promise.<Size>}
Returns:
- Type
- Promise.<Size>
snapshot(optionsopt) → {Promise.<string>}
Parameters:
Name | Type | Attributes | Description | ||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|
options | Object |
<optional> | An options object that defines the image capture preferences.
Properties
|
Returns:
- Type
- Promise.<string>
tagName() → {Promise.<string>}
Returns:
- Type
- Promise.<string>
text() → {Promise.<number>}
Returns the text displayed for the object.
Returns:
- Type
- Promise.<number>
verifyImageExists(imageToFind, similarityopt) → {Promise.<Object>}
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
imageToFind | string | A Base64 string representation of the image to look for within the test object's snapshot. | |
similarity | number |
<optional> | The minimum similarity between the two images (as a percentage), above which the find is considered a match. Default = 100. |
Returns:
- Type
- Promise.<Object>
verifyImageMatch(expectedImage, pixelToleranceopt, rgbToleranceopt) → {Promise.<boolean>}
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
expectedImage | string | A Base64 string representation of the image to compare to the test object snapshot. | |
pixelTolerance | number |
<optional> | The percentage of pixels that can differ between the two images, and still be considered a match. Default = 0. |
rgbTolerance | number |
<optional> | The percentage by which the RGB values of the pixels in the two images can differ, and still be considered a match. Default = 0. |
Returns:
- Type
- Promise.<boolean>
verifyImageMatchWithMask(expectedImage, maskAreaImage, pixelToleranceopt, rgbToleranceopt) → {Promise.<boolean>}
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
expectedImage | string | A Base64 string representation of the image to compare to the test object snapshot. | |
maskAreaImage | string | A Base64 string representation of the image mask area to use in the image comparison. | |
pixelTolerance | number |
<optional> | The percentage of pixels that can differ between the two images, and still be considered a match. Default = 0. |
rgbTolerance | number |
<optional> | The percentage by which the RGB values of the pixels in the two images can differ, and still be considered a match. Default = 0. |
Returns:
- Type
- Promise.<boolean>
waitUntilEnabled(timeout[opt]) → {Promise.<boolean>}
Supported on UFT Developer versions 15.0.1 and later
Waits until this test object becomes enabled or until the specified timeout elapses. This method is useful for synchronizing your test with your application.
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
timeout | number |
<optional> | The time (in milliseconds) to wait for the test object to become enabled. |
Returns:
a promise fulfilled with true if test object becomes enabled before the timeout is reached; otherwise, false.
- Type
- Promise.<boolean>
waitUntilExists(timeout[opt]) → {Promise.<boolean>}
Waits until this test object exists or until the specified timeout elapses. This method is useful for synchronizing your test with your application.
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
timeout | number |
<optional> | The time (in seconds) to wait for this object to exist. By default, uses the object synchronization timeout defined in the runtime engine settings. |
Returns:
- Type
- Promise.<boolean>
waitUntilVisible(timeout[opt]) → {Promise.<boolean>}
Waits until this test object becomes visible or the timeout elapses. This method is useful for synchronizing your test with your application.
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
timeout | number |
<optional> | The time (in milliseconds) to wait for the test object to become visible. |
Returns:
a promise fulfilled with true if test object becomes visible before the timeout is reached; otherwise, false.
- Type
- Promise.<boolean>