Window

Supported in UFT Developer version 2023 and later

UIA Pro is supported as a technical preview.

UIAPro. Window

new Window(propsopt) → {Window}

The description of a UIAPro window test object.

Parameters:

NameTypeAttributesDescription
propsObject <optional>
Initializes a UIAPro Window test object using the supplied property bag.

Returns:

the description object that was initialized.
Type
Window

Methods

absX(absXopt) → {number|Description}

The object's absolute x-coordinate (left) relative to the parent object (in pixels).

Parameters:

NameTypeAttributesDescription
absXnumber <optional>
When provided, this method acts as a setter and sets the absX value.

Returns:

The current stored absX value; otherwise it returns 'this' for use with the builder pattern.
Type
number | Description

absY(absYopt) → {number|Description}

The object's absolute y-coordinate (top) relative to the parent object (in pixels).

Parameters:

NameTypeAttributesDescription
absYnumber <optional>
When provided, this method acts as a setter and sets the absY value.

Returns:

The current stored absY value; otherwise it returns 'this' for use with the builder pattern.
Type
number | Description

acceleratorKey(acceleratorKeyopt) → {string|Description}

The sequence of key combinations that invoke an action associated with the element.

Parameters:

NameTypeAttributesDescription
acceleratorKeystring <optional>
When provided, this method acts as a setter and sets the acceleratorKey value.

Returns:

If no parameter is provided, the method acts as a getter and returns the current stored acceleratorKey value; otherwise it returns 'this' for use with the builder pattern.
Type
string | Description

accessKey(accessKeyopt) → {string|Description}

The character that is used to activate the object.

Parameters:

NameTypeAttributesDescription
accessKeystring <optional>
When provided, this method acts as a setter and sets the accessKey value.

Returns:

If no parameter is provided, the method acts as a getter and returns the current stored accessKey value; otherwise it returns 'this' for use with the builder pattern.
Type
string | Description

automationId(automationIdopt) → {string|Description}

The ID for an object that is unique among siblings within its container.

Parameters:

NameTypeAttributesDescription
automationIdstring <optional>
When provided, this method acts as a setter and sets the automationId value.

Returns:

If no parameter is provided, the method acts as a getter and returns the current stored automationId value; otherwise it returns 'this' for use with the builder pattern.
Type
string | Description

controlType(controlTypeopt) → {string|Description}

The UIAPro type for the object.

Parameters:

NameTypeAttributesDescription
controlTypestring <optional>
When provided, this method acts as a setter and sets the controlType value.

Returns:

If no parameter is provided, the method acts as a getter and returns the current stored controlType value; otherwise it returns 'this' for use with the builder pattern.
Type
string | Description

frameworkId(frameworkIdopt) → {string|Description}

The name of the UI framework, such as Win32, WinForm, or DirectUI.

Parameters:

NameTypeAttributesDescription
frameworkIdstring <optional>
When provided, this method acts as a setter and sets the frameworkId value.

Returns:

If no parameter is provided, the method acts as a getter and returns the current stored frameworkId value; otherwise it returns 'this' for use with the builder pattern.
Type
string | Description

handle(handleopt) → {number|Description}

The run-time object's window handle.

Parameters:

NameTypeAttributesDescription
handlenumber <optional>
When provided, this method acts as a setter and sets the handle value.

Returns:

The current stored handle value; otherwise it returns 'this' for use with the builder pattern.
Type
number | Description

hasKeyBoardFocus(hasKeyBoardFocusopt) → {boolean|Description}

Indicates whether the object has keyboard focus.

Parameters:

NameTypeAttributesDescription
hasKeyBoardFocusboolean <optional>
When provided, this method acts as a setter and sets the hasKeyBoardFocus value.

Returns:

The current stored hasKeyBoardFocus value; otherwise it returns 'this' for use with the builder pattern.
Type
boolean | Description

height(heightopt) → {number|Description}

The object's height (in pixels).

Parameters:

NameTypeAttributesDescription
heightnumber <optional>
When provided, this method acts as a setter and sets the height value.

Returns:

The current stored height value; otherwise it returns 'this' for use with the builder pattern.
Type
number | Description

isEnabled(isEnabledopt) → {boolean|Description}

Indicates whether the object is enabled.

Parameters:

NameTypeAttributesDescription
isEnabledboolean <optional>
When provided, this method acts as a setter and sets the isEnabled value.

Returns:

The current stored isEnabled value; otherwise it returns 'this' for use with the builder pattern.
Type
boolean | Description

isKeyboardFocusable(isKeyboardFocusableopt) → {boolean|Description}

Indicates whether the object can accept keyboard focus.

Parameters:

NameTypeAttributesDescription
isKeyboardFocusableboolean <optional>
When provided, this method acts as a setter and sets the isKeyboardFocusable value.

Returns:

The current stored isKeyboardFocusable value; otherwise it returns 'this' for use with the builder pattern.
Type
boolean | Description

isOffScreen(isOffScreenopt) → {boolean|Description}

Indicates whether the object is Offscreen.

Parameters:

NameTypeAttributesDescription
isOffScreenboolean <optional>
When provided, this method acts as a setter and sets the isOffScreen value.

Returns:

The current stored isOffScreen value; otherwise it returns 'this' for use with the builder pattern.
Type
boolean | Description

isPassword(isPasswordopt) → {boolean|Description}

Indicates whether the object contains protected content or a password.

Parameters:

NameTypeAttributesDescription
isPasswordboolean <optional>
When provided, this method acts as a setter and sets the isPassword value.

Returns:

The current stored isPassword value; otherwise it returns 'this' for use with the builder pattern.
Type
boolean | Description

name(nameopt) → {string|Description}

The name of the control.

Parameters:

NameTypeAttributesDescription
namestring <optional>
When provided, this method acts as a setter and sets the name value.

Returns:

If no parameter is provided, the method acts as a getter and returns the current stored name value; otherwise it returns 'this' for use with the builder pattern.
Type
string | Description

nativeClass(nativeClassopt) → {string|Description}

The class name assigned to the test object.

Parameters:

NameTypeAttributesDescription
nativeClassstring <optional>
When provided, this method acts as a setter and sets the nativeClass value.

Returns:

If no parameter is provided, the method acts as a getter and returns the current stored nativeClass value; otherwise it returns 'this' for use with the builder pattern.
Type
string | Description

path(pathopt) → {string|Description}

The path in the application's object hierarchy, separated by semicolons. Objects in the path are represented by their name or automationId property values.

Parameters:

NameTypeAttributesDescription
pathstring <optional>
When provided, this method acts as a setter and sets the path value.

Returns:

If no parameter is provided, the method acts as a getter and returns the current stored path value; otherwise it returns 'this' for use with the builder pattern.
Type
string | Description

processId(processIdopt) → {number|Description}

The UIAutomation object process id.

Parameters:

NameTypeAttributesDescription
processIdnumber <optional>
When provided, this method acts as a setter and sets the processId value.

Returns:

The current stored processId value; otherwise it returns 'this' for use with the builder pattern.
Type
number | Description

processName(processNameopt) → {string|Description}

The UIAutomation object process name.

Parameters:

NameTypeAttributesDescription
processNamestring <optional>
When provided, this method acts as a setter and sets the processName value.

Returns:

The current stored processName value; otherwise it returns 'this' for use with the builder pattern.
Type
string | Description

status(statusopt) → {string|Description}

Describes the status of the current object. For example, an item associated with a contact in a messaging application might be "Busy" or "Connected".

Parameters:

NameTypeAttributesDescription
statusstring <optional>
When provided, this method acts as a setter and sets the status value.

Returns:

The current stored status value; otherwise it returns 'this' for use with the builder pattern.
Type
string | Description

supportedPatterns(supportedPatternsopt) → {Array.<string>|Description}

The list of patterns supported for the test object.

Parameters:

NameTypeAttributesDescription
supportedPatternsArray.<string> <optional>
When provided, this method acts as a setter and sets the supportedPatterns value.

Returns:

If no parameter is provided, the method acts as a getter and returns the current stored supportedPatterns value; otherwise it returns 'this' for use with the builder pattern.
Type
Array.<string> | Description

width(widthopt) → {number|Description}

The object's width (in pixels).

Parameters:

NameTypeAttributesDescription
widthnumber <optional>
When provided, this method acts as a setter and sets the width value.

Returns:

The current stored width value; otherwise it returns 'this' for use with the builder pattern.
Type
number | Description

x(xopt) → {number|Description}

The object's x-coordinate (left) relative to the parent object (in pixels).

Parameters:

NameTypeAttributesDescription
xnumber <optional>
When provided, this method acts as a setter and sets the x value.

Returns:

The current stored x value; otherwise it returns 'this' for use with the builder pattern.
Type
number | Description

y(yopt) → {number|Description}

The object's y-coordinate (top) relative to the parent object (in pixels).

Parameters:

NameTypeAttributesDescription
ynumber <optional>
When provided, this method acts as a setter and sets the y value.

Returns:

The current stored y value; otherwise it returns 'this' for use with the builder pattern.
Type
number | Description