UIAProProgressBar Object

This object is supported as a technical preview.

Description

A progress bar object in an application that supports UIAutomation.

IMPORTANT

The UIAProProgressBar object represents controls with Control Type UIA_ProgressBarControlTypeId = 50012

Operations

The sections below list the built-in methods and properties that you can use as operations for the UIAProProgressBar object.

Note: You can also view a list and descriptions of the UIAProProgressBar description properties, for use in object repository descriptions, programmatic descriptions, checkpoint and output value steps, and as argument values for the GetTOProperty and GetROProperty methods.

Common methods and properties

Common Methods

ActivateDouble-clicks the object to activate it.
Common Method CaptureBitmapSaves a screen capture of the object as a .png or .bmp image, depending on the specified file extension.
Common Method CheckChecks whether the actual value of an item matches the expected value.
Common Method CheckPropertyChecks whether the specified object property achieves the specified value within the specified timeout.
Common Method ChildObjectsReturns the collection of child objects contained within the object.
ClickClicks the object.
Common Method GetAllROProperties

Returns the collection of properties and current values from the object in the application.

Common Method GetROPropertyReturns the current value of the specified description property from the object in the application.
GetSupportedPatternsReturns an array that contains the patterns supported by the current UI Automation object.
Common Method GetTOPropertiesReturns the collection of properties and values used to identify the object.
Common Method GetTOPropertyReturns the value of the specified description property from the test object description.
HasSupportedPatternIndicates whether the current UI Automation object supports a specific automation pattern.
HasSupportedPatternsIndicates whether the current UI Automation object supports the specified automation patterns.
Common Method HighlightHighlights the object in the application.
Common Method OutputRetrieves the current value of an item and stores it in a specified location.
Common Method RefreshObjectInstructs UFT One to re-identify the object in the application the next time a step refers to this object.
Common Method SetTOPropertySets the value of the specified description property in the test object description.
Common Method ToString

Returns a string that represents the current test object.

TypeSimulates keyboard input on the object.
Common Method WaitPropertyWaits until the specified object property achieves the specified value or exceeds the specified timeout before continuing to the next step.

Common Property

Common Property ExistChecks whether the object currently exists in the open application.

UIAPro Pattern-Based methods and properties

ExpandCollapse pattern

Method/PropertyDescription
CollapseHides all child nodes, controls, or content of the element.
ExpandDisplays all child nodes, controls, or content of the element.
GetExpandCollapseStateGets the Expand or Collapse state of the element.

Grid pattern

MethodDescription
ActivateCellActivates (double-clicks) the specified cell in the grid.
AddCellToSelectionSelects a cell in addition to previously selected cells.
AddRowToSelectionSelects a row in addition to previously selected rows.
ClickCellClicks the specified cell in the grid.
GetCellRetrieves a UI Automation object representing an item in the grid.
GetCellNameReturns the value of the name property for the specified cell.
GetCellTextReturns the text provided by the cell’s Text pattern.
GetCellValueReturns the value provided by the cell's Value pattern.
GetColumnCountRetrieves the number of columns in the grid.
GetRowCountRetrieves the number of rows in the grid.
SelectCellSelects a cell in the grid.
SetCellValueSets the specified cell’s value using the Value pattern.

GridItem pattern

MethodDescription
GetColumnIndexRetrieves the zero-based index of the column that contains the grid item.
GetContainingGridRetrieves a UI Automation object that supports Grid pattern and represents the container of the cell or item.
GetRowIndexRetrieves the zero-based index of the row that contains the grid item.
GetSpannedColumnsRetrieves the number of columns spanned by a cell or item.
GetSpannedRowsRetrieves the number of rows spanned by a cell or item.

Invoke pattern

MethodDescription
InvokeInvokes the action of a control, such as a button click.

LegacyIAccessible pattern

MethodDescription
GetChildIdRetrieves the Microsoft Active Accessibility child identifier for the current object.
GetDefaultOperationRetrieves the Microsoft Active Accessibility default operation for the current object.
GetDescriptionRetrieves the Microsoft Active Accessibility description for the current object.
GetHelpRetrieves the Microsoft Active Accessibility help string for the current object.
GetKeyboardShortcutRetrieves the Microsoft Active Accessibility keyboard shortcut for the current object.
GetNameRetrieves the Microsoft Active Accessibility name for the current object.
GetRoleRetrieves the Microsoft Active Accessibility role for the current object.
GetSelectedChildrenRetrieves the Microsoft Active Accessibility selected children of the current object.
GetStateRetrieves the Microsoft Active Accessibility state for the current object.
GetValueRetrieves the Microsoft Active Accessibility value for the current object.
SelectSelects the element.
SetSecureValueSets the encoded Microsoft Active Accessibility value for the current object.
SetValueSets the Microsoft Active Accessibility value for the current object.
PerformDefaultOperationPerforms the default operation on the control.

RangeValue pattern

Method/PropertyDescription
GetLargeChangeGets the control-specific large-change value that is added to or subtracted from the Value of the current UI Automation object.
GetMaximumGets the maximum value supported by the UI Automation object.
GetMinimumGets the minimum value supported by the UI Automation object.
GetSmallChangeGets the control-specific small-change value that is added to or subtracted from the Value of the current UI Automation object.
GetValueGets the current value of the UI Automation object.
Common Property IsReadOnlyIndicates whether the value of a UI Automation object is read-only.
SetValueSets the current value of the UI Automation object.

Scroll pattern

Method/PropertyDescription
Common Property CanScrollHorizontallyIndicates whether the UI Automation element can scroll horizontally.
Common Property CanScrollVerticallyIndicates whether the UI Automation element can scroll vertically.
GetHorizontalScrollPercentGets the current horizontal scroll position.
GetHorizontalViewSizeGets the current horizontal view size.
GetVerticalScrollPercentGets the current vertical scroll position.
GetVerticalViewSizeGets the current vertical view size.
ScrollScrolls the visible region of the content area horizontally and vertically.
ScrollHorizontalScrolls the visible region of the content area horizontally.
ScrollVerticalScrolls the visible region of the content area vertically.
SetHorizontalScrollPercentSets the horizontal scroll position as a percentage of the total content area within the automation element.
SetScrollPercentSets the horizontal and vertical scroll position as a percentage of the total content area within the automation element.
SetVerticalScrollPercentSets the vertical scroll position as a percentage of the total content area within the automation element.

ScrollItem pattern

Method/PropertyDescription
ScrollIntoView

Scrolls an item in a scrollable view into view.

Selection pattern

Method/PropertyDescription
Common Property CanSelectMultipleItemsIndicates whether multiple items in the container can be selected at once.
Common Property IsSelectionRequiredGets a value that specifies whether the container requires at least one child item to be selected.
GetSelectedChildrenRetrieves all selected items from the container.

SelectionItem pattern

Method/PropertyDescription
AddToSelectionSelects the item in addition to the previously selected items.
Common Property IsSelected Indicates whether the item is selected.
RemoveFromSelectionDeselects the current item.
SelectDeselects any selected items and then selects the current item.

Table pattern

MethodDescription
GetColumnHeadersRetrieves a collection of UI Automation objects representing all the column headers in a table.
GetPrimaryTraversalDirectionRetrieves the primary direction of traversal for the table.
GetRowHeadersRetrieves a collection of UI Automation objects representing all the row headers in a table.

TableItem pattern

MethodDescription
GetColumnHeaderItemsRetrieves the column headers associated with a table item or cell.
GetRowHeaderItemsRetrieves the row headers associated with a table item or cell.

Text pattern

MethodDescription

ClearSelection

Clears any text selections in the object.

GetSelection

Returns the object's selected text, or an empty string if no text is selected.
GetSupportedSelectionModeIndicates the type of text selection that is supported by the control.
GetTextRetrieves the text of the object.

GetVisibleText

Returns all visible text from the object.

ScrollIntoView

Scrolls a text control to bring the specified area into view.

Select

Selects the specified text in the object.

SelectAll

Selects all of the object’s text.

Toggle pattern

MethodDescription
GetToggleStateProvides access to the property values of a Toggle Pattern object using its Current or Cached accessors.
ToggleCycles through the toggle states of the control.

Value pattern

Method/PropertyDescription
GetValueRetrieves the value of the UI Automation element.
Common Property IsReadOnlyIndicates whether the value of the control is read-only.
SetSecureValueSets the encrypted value of the UI Automation element.
SetValueSets the value of the UI Automation element.

Window pattern

Method/PropertyDescription
Common Property CanMaximizeIndicates whether the window can be maximized.
Common Property CanMinimize

Indicates whether the window can be minimized.

CloseCloses the window.
GetWindowInteractionStateRetrieves the interaction state of the window.
GetWindowVisualStateRetrieves the visual state of the window.
Common Property IsMaximizedIndicates whether the window is maximized.
Common Property IsMinimizedIndicates whether the window is minimized.
Common Property IsModalIndicates whether the window is modal.
Common Property IsTopMostIndicates whether the window is set to always be displayed in front of other windows.
MaximizeEnlarges the window to full screen size.

Minimize

Reduces the window to an icon.
RestoreRestores the window to its previous size.
WaitForInputIdleWaits until the window is ready for input or the timeout expires.

Back to top

Activate Method

Description

Double-clicks the object to activate it.

Syntax

object.Activate [x],[y]

Arguments

ParameterDescription
x

Optional. A long integer value.

The x-coordinate of the object to click.

y

Optional. A long integer value.

The y-coordinate of the object to click.

Return Type

None

Back to top

Click Method

Description

Clicks the object.

Syntax

object.Click [x],[y], [button]

Arguments

ParameterDescription
x

Optional. A long integer value.

The x-coordinate of the object to click.

y

Optional. A long integer value.

The y-coordinate of the object to click.

button

Optional. A predefined constant or number.

The mouse button used to perform the click.

Return Type

None

Example

Back to top

GetSupportedPatterns Method

Description

Returns an array that contains the patterns supported by the current UI Automation object.

Syntax

object.GetSupportedPatterns

Return Type

An array

Back to top

HasSupportedPattern Method

Description

Indicates whether the current UI Automation object supports a specific automation pattern.

Syntax

object.HasSupportedPattern (string patternName)

Arguments

ParameterDescription
PatternName

An automation pattern.

Return Type

A value of Boolean type.

Back to top

HasSupportedPatterns Method

Description

Indicates whether the current UI Automation object supports the specified automation patterns.

Syntax

object.HasSupportedPatterns (string patternNames)

Arguments

ParameterDescription
PatternName

A semi-colon delimited list of automation patterns.

Return Type

A value of Boolean type.

Back to top

Type Method

Description

Simulates keyboard input on the object.

Syntax

object.Type string

Arguments

ParameterDescription
string

Required. A string.

The characters to enter in the object.

Return Type

None

Back to top

ActivateCell Method

Description

Activates (double-clicks) the specified cell in the grid.

Syntax

object.GridPattern.ActivateCell rowIndex, columnIndex, [x, y]

Arguments

ParameterDescription
rowIndex

Required. An integer.

The cell row index.

columnIndex

Required. An integer.

The cell column index.

x

Optional. An integer.

The x-coordinate of the location to click within the cell.

y

Optional. An integer.

The y-coordinate of the location to click within the cell.

Return Type

None

IMPORTANT

This method is available only if you implement the Grid pattern in an object in your application.

Back to top

AddCellToSelection Method

Description

Selects a cell in addition to previously selected cells.

Syntax

object.GridPattern.AddCellToSelection rowIndex, columnIndex

Arguments

ParameterDescription
rowIndex

Required. An integer.

The cell row index.

columnIndex

Required. An integer.

The cell column index.

Return Type

None

IMPORTANT

This method is available only if you implement the Grid pattern in an object in your application.

Back to top

AddRowToSelection Method

Description

Selects a row in addition to previously selected rows.

Syntax

object.GridPattern.AddRowToSelection rowIndex

Arguments

ParameterDescription
rowIndex

Required. An integer.

The row to select.

Return Type

None

IMPORTANT

This method is available only if you implement the Grid pattern in an object in your application.

Back to top

AddToSelection Method

Description

Selects the item in addition to the previously selected items.

Syntax

object.SelectionItemPattern.AddToSelection

Return Type

None

IMPORTANT

This method is available only if you implement the SelectionItem pattern in an object in your application.

Back to top

CanMaximize Property

Description

Indicates whether the window can be maximized.

Syntax

object.WindowPattern.CanMaximize

Return Type

A value of Boolean type.

IMPORTANT

This property is available only if you implement the Window pattern in an object in your application.

Back to top

CanMinimize Property

Description

Indicates whether the window can be minimized.

Syntax

object.WindowPattern.CanMinimize

Return Type

A value of Boolean type.

IMPORTANT

This property is available only if you implement the Window pattern in an object in your application.

Back to top

CanScrollHorizontally Property

Description

Indicates whether the UI Automation element can scroll horizontally.

Syntax

object.ScrollPattern.CanScrollHorizontally

Return Type

A value of Boolean type.

IMPORTANT

This method is available only if you implement the Scroll pattern in an object in your application.

Back to top

CanScrollVertically Property

Description

Indicates whether the UI Automation element can scroll vertically.

Syntax

object.ScrollPattern.CanScrollVertically

Return Type

A value of Boolean type.

IMPORTANT

This method is available only if you implement the Scroll pattern in an object in your application.

Back to top

CanSelectMultipleItems Property

Description

Indicates whether multiple items in the container can be selected at once.

Syntax

object.SelectionPattern.CanSelectMultipleItems

Return Type

A value of Boolean type.

IMPORTANT

This method is available only if you implement the Selection pattern in an object in your application.

Back to top

ClearSelection Method

Description

Clears any text selections in the object.

Syntax

object.TextPattern.ClearSelection

Return Type

None

IMPORTANT

This method is available only if you implement the Text pattern in an object in your application.

Back to top

ClickCell Method

Description

Clicks the specified cell in the grid.

Syntax

object.GridPattern.ClickCell rowIndex,columnIndex, [x], [y], [button]

Arguments

ParameterDescription
rowIndex

Required. An integer.

The cell row index.

columnIndex

Required. An integer.

The cell column index

x

Optional. An integer.

The x-coordinate of the location to click within the cell.

Default = The center of the axis.

y

Optional. An integer.

The y-coordinate of the location to click within the cell.

Default = The center of the axis.

button

Optional. The mouse button used to perform the cell click.

Possible values: 

  • 0 = left button (Default)
  • 1 = right button
  • 2 = middle button

Return Type

None

IMPORTANT

This method is available only if you implement the Grid pattern in an object in your application.

Back to top

Close Method

Description

Closes the window.

Syntax

object.WindowPattern.Close

Return Type

None

IMPORTANT

This method is available only if you implement the Window pattern in an object in your application.

Back to top

Collapse Method

Description

Hides all child nodes, controls, or content of the element.

Syntax

object.ExpandCollapsePattern.Collapse

Return Type

None

IMPORTANT

This method is available only if you implement the ExpandCollapse pattern in an object in your application.

Back to top

Expand Method

Description

Displays all child nodes, controls, or content of the element.

Syntax

object.ExpandCollapsePattern.Expand

Return Type

None

IMPORTANT

This method is available only if you implement the ExpandCollapse pattern in your application.

Back to top

GetCell Method

Description

Retrieves a UI Automation object representing an item in the grid.

Syntax

object.GridPattern.GetCell(int rowIndex, int columnIndex)

Arguments

ParameterDescription
rowIndex

Required. An integer.

The cell row index.

columnIndex

Required. An integer.

The cell column index.

Return Type

A UI Automation object.

IMPORTANT

This method is available only if you implement the Grid pattern in your application.

Back to top

GetCellName Method

Description

Returns the value of the name property for the specified cell.

Syntax

object.GridPattern.GetCellName rowIndex, columnIndex

Arguments

ParameterDescription
rowIndex

Required. An integer value.

The cell row index.

columnIndex

Required. An integer value.

The cell column index.

Return Type

The value of the name property for the specified cell.

Back to top

GetCellValue Method

Description

Returns the value provided by the cell's value pattern.

Syntax

object.GridPattern.GetCellValue rowIndex, columnIndex

Arguments

ParameterDescription
rowIndex

Required. An integer value.

The cell row index.

columnIndex

Required. An integer value.

The cell column index.

Return Type

The value of the value property for the specified cell.

Back to top

GetCellText Method

Description

Returns the text provided by the cell's Text pattern.

Syntax

object.GridPattern.GetCellText(int rowIndex, int columnIndex)

Arguments

ParameterDescription
rowIndex

Required. An integer.

The cell row index.

columnIndex

Required. An integer.

The cell column index.

Return Type

A text string.

IMPORTANT

This method is available only if you implement the Grid pattern in your application.

Back to top

GetChildId Method

Description

Retrieves the Microsoft Active Accessibility child identifier for the current object.

Syntax

object.LegacyIAccessiblePattern.GetChildId

Return Type

An integer.

IMPORTANT

This method is available only if you implement the LegacyIAccessible pattern in your application.

Back to top

GetColumnCount Method

Description

Retrieves the number of columns in the grid.

Syntax

object.GridPattern.GetColumnCount

Return Type

An integer.

IMPORTANT

This method is available only if you implement the Grid pattern in your application.

Back to top

GetColumnHeaders Method

Description

Retrieves a collection of UI Automation objects representing all the column headers in a table.

Syntax

object.TablePattern.GetColumnHeaders

Return Type

A collection of UI Automation objects.

IMPORTANT

This method is available only if you implement the Table pattern in an object in your application.

Back to top

GetColumnHeaderItems Method

Description

Retrieves the column headers associated with a table item or cell.

Syntax

object.TableItemPattern.GetColumnHeaderItems

Return Type

A collection of UI Automation objects.

IMPORTANT

This method is available only if you implement the TableItem pattern in an object in your application.

Back to top

GetColumnIndex Method

Description

Retrieves the zero-based index of the column that contains the grid item.

Syntax

object.GridItemPattern.GetColumnIndex

Return Type

An integer.

IMPORTANT

This method is available only if you implement the GridItem pattern in an object in your application.

Back to top

GetContainingGrid Method

Description

Retrieves a UI Automation object that supports the Grid pattern and represents the container of the cell or item.

Syntax

object.GridItemPattern.GetContainingGrid

Return Type

A UI Automation object.

IMPORTANT

This method is available only if you implement the GridItem pattern in an object in your application.

Back to top

GetDescription Method

Description

Retrieves the Microsoft Active Accessibility description for the current object.

Syntax

object.LegacyIAccessiblePattern.GetDescription

Return Type

A string.

IMPORTANT

This method is available only if you implement the LegacyIAccessible pattern in an object in your application.

Back to top

GetDefaultOperation Method

Description

Retrieves the Microsoft Active Accessibility default operation for the current object.

Syntax

object.LegacyIAccessiblePattern.GetDefaultOperation

Return Type

A string.

IMPORTANT

This method is available only if you implement the LegacyIAccessible pattern in an object in your application.

Back to top

GetExpandCollapseState Method

Description

Gets the ExpandCollapse state of the element.

Syntax

object.ExpandCollapsePattern.GetExpandCollapseState

Return Type

ExpandCollapsestate.

ExpandCollapse state.

Possible values: 

  • 0 = Collapsed. No child nodes, controls, or content of the UI Automation element are displayed.

  • 1 = Expanded. All child nodes, controls or content of the UI Automation element are displayed.

  • 2 = PartiallyExpanded. Some, but not all, child nodes, controls, or content of the UI Automation element are displayed.

  • 3 = LeafNode. The UI Automation element has no child nodes, controls, or content to display.

IMPORTANT

The ExpandCollapse state refers to the visibility of immediate child objects only; it does not refer to the visibility of all descendant objects.

This method is available only if you implement the ExpandCollapse pattern in an object in your application.

Back to top

GetHelp Method

Description

Retrieves the Microsoft Active Accessibility help string for the current object.

Syntax

object.LegacyIAccessiblePattern.GetHelp

Return Type

A help string.

IMPORTANT

This method is available only if you implement the LegacyIAccessible pattern in an object in your application.

Back to top

GetHorizontalScrollPercent Method

Description

Gets the current horizontal scroll position.

Syntax

object.ScrollPattern.GetHorizontalScrollPercent

Return Type

A value of Double type.

IMPORTANT

This method is available only if you implement the Scroll pattern in an object in your application.

Back to top

GetHorizontalViewSize Method

Description

Gets the current horizontal view size.

Syntax

object.ScrollPattern.GetHorizontalViewSize

Return Type

A value of Double type.

IMPORTANT

This method is available only if you implement the Scroll pattern in an object in your application.

Back to top

GetKeyboardShortcut Method

Description

Retrieves the Microsoft Active Accessibility keyboard shortcut for the current object.

Syntax

object.LegacyIAccessiblePattern.GetKeyboardShortcut

Return Type

A string.

IMPORTANT

This method is available only if you implement the LegacyIAccessible pattern in an object in your application.

Back to top

GetLargeChange Method

Description

Gets the control-specific large-change value that is added to or subtracted from the Value of the current UI Automation object.

Syntax

object.RangeValuePattern.GetLargeChange

Return Type

A value of Double type.

IMPORTANT

This method is available only if you implement the RangeValue pattern in an object in your application.

Back to top

GetMaximum Method

Description

Gets the maximum value supported by the UI Automation object.

Syntax

object.RangeValuePattern.GetMaximum

Return Type

A value of Double type.

IMPORTANT

This method is available only if you implement the RangeValue pattern in an object in your application.

Back to top

GetMinimum Method

Description

Gets the minimum value supported by the UI Automation object.

Syntax

object.RangeValuePattern.GetMinimum

Return Type

A value of Double type.

IMPORTANT

This method is available only if you implement the RangeValue pattern in an object in your application.

Back to top

GetName Method

Description

Retrieves the Microsoft Active Accessibility name for the current object.

Syntax

object.LegacyIAccessiblePattern.GetName

Return Type

A string.

IMPORTANT

This method is available only if you implement the LegacyIAccessible pattern in an object in your application.

Back to top

GetPrimaryTraversalDirection Method

Description

Retrieves the primary direction of traversal for the table.

Syntax

object.TablePattern.GetPrimaryTraversalDirection

Return Type

The table traversal direction.

IMPORTANT

This method is available only if you implement the Table pattern in an object in your application.

Back to top

GetRole Method

Description

Retrieves the Microsoft Active Accessibility role for the current object.

Syntax

object.LegacyIAccessiblePattern.GetRole

Return Type

An accessible role.

IMPORTANT

This method is available only if you implement the LegacyIAccessible pattern in an object in your application.

Back to top

GetRowHeaders Method

Description

Retrieves a collection of UI Automation objects representing all the row headers in a table.

Syntax

object.TablePattern.GetRowHeaders

Return Type

A collection of UI Automation objects.

IMPORTANT

This method is available only if you implement the Table pattern in an object in your application.

Back to top

GetRowHeaderItems Method

Description

Retrieves the row headers associated with a table item or cell.

Syntax

object.TableItemPattern.GetRowHeaderItems

Return Type

A collection of UI Automation objects.

IMPORTANT

This method is available only if you implement the TableItem pattern in an object in your application.

Back to top

GetRowCount Method

Description

Retrieves the number of rows in the grid.

Syntax

object.GridPattern.GetRowCount

Return Type

An integer

IMPORTANT

This method is available only if you implement the Grid pattern in an object in your application.

Back to top

GetRowIndex Method

Description

Retrieves the zero-based index of the row that contains the grid item.

Syntax

object.GridItemPattern.GetRowIndex

Return Type

An integer

IMPORTANT

This method is available only if you implement the GridItem pattern in an object in your application.

Back to top

GetSelection Method

Description

Returns the object's selected text, or an empty string if no text is selected.

Syntax

object.TextPattern.GetSelection

Return Type

A string

IMPORTANT

  • For multiple selections, the result is a single string in which selected entities are concatenated with no separator and sorted by their positions in text, in ascending order.

  • This method is available only if you implement the Text pattern in an object in your application.

Back to top

GetSelectedChildren Method

Description

Retrieves the Microsoft Active Accessibility selected children of the current object.

Syntax

object.LegacyIAccessiblePattern.GetSelectedChildren

Return Type

A UI Automation object.

IMPORTANT

This method is available only if you implement the LegacyIAccessible pattern in an object in your application.

Back to top

GetSelectedChildren Method

Description

Retrieves all selected items from the container.

Syntax

object.SelectionPattern.GetSelectedChildren

Return Type

A UI Automation object.

IMPORTANT

This method is available only if you implement the Selection pattern in an object in your application.

Back to top

GetSmallChange Method

Description

Gets the control-specific small-change value that is added to or subtracted from the Value of the current UI Automation object.

Syntax

object.RangeValuePattern.GetSmallChange

Return Type

A value of Double type.

IMPORTANT

This method is available only if you implement the RangeValue pattern in an object in your application.

Back to top

GetSpannedColumns Method

Description

Retrieves the number of columns spanned by a cell or item.

Syntax

object.GridItemPattern.GetSpannedColumns

Return Type

An integer

IMPORTANT

This method is available only if you implement the GridItem pattern in an object in your application.

Back to top

GetSpannedRows Method

Description

Retrieves the number of rows spanned by a cell or item.

Syntax

object.GridItemPattern.GetSpannedRows

Return Type

An integer.

IMPORTANT

This method is available only if you implement the GridItem pattern in an object in your application.

Back to top

GetState Method

Description

Retrieves the Microsoft Active Accessibility state for the current object.

Syntax

object.LegacyIAccessiblePattern.GetState

Return Type

The accessibility state.

IMPORTANT

This method is available only if you implement the LegacyIAccessible pattern in an object in your application.

Back to top

GetSupportedSelectionMode Method

Description

Indicates the type of text selection that is supported by the control.

Syntax

object.TextPattern.GetSupportedSelectionMode

Return Type

A number indicating the type of text selection the object supports.

  • 0: No text selection supported.

  • 1: Supports a single and continuous text selection.

  • 2: Supports multiple and non-contiguous text selections.

IMPORTANT

This method is available only if you implement the Text pattern in an object in your application.

Back to top

GetText Method

Description

Retrieves the text of the object.

Syntax

object.TextPattern.GetText

Return Type

A string with the text of an object.

IMPORTANT

This method is available only if you implement the Text pattern in an object in your application.

Back to top

GetToggleState Method

Description

Provides access to the property values of a Toggle Pattern object using its Current or Cached accessors.

Syntax

object.TogglePattern.GetToggleState

Return Type

The toggle state.

IMPORTANT

This method is available only if you implement the Toggle pattern in an object in your application.

Back to top

GetValue Method

Description

Retrieves the value of the UI Automation element.

Syntax

object.ValuePattern.GetValue

Return Type

A string

IMPORTANT

This method is available only if you implement the Value pattern in an object in your application.

Back to top

GetValue Method

Description

Gets the current value of the UI Automation object.

Syntax

object.RangeValuePattern.GetValue

Return Type

A string.

IMPORTANT

This method is available only if you implement the RangeValue pattern in an object in your application.

Back to top

GetValue Method

Description

Retrieves the Microsoft Active Accessibility value for the current object.

Syntax

object.LegacyIAccessiblePattern.GetValue

Return Type

A string.

IMPORTANT

This method is available only if you implement the LegacyIAccessible pattern in an object in your application.

Back to top

GetVerticalScrollPercent Method

Description

Gets the current vertical scroll position.

Syntax

object.ScrollPattern.GetVerticalScrollPercent

Return Type

A value of Double type.

IMPORTANT

This method is available only if you implement the Scroll pattern in an object in your application.

Back to top

GetVerticalViewSize Method

Description

Gets the current vertical view size.

Syntax

object.ScrollPattern.GetVerticalViewSize

Return Type

A value of Double type.

IMPORTANT

This method is available only if you implement the Scroll pattern in an object in your application.

Back to top

GetVisibleText Method

Description

Returns all visible text from the object.

Syntax

object.TextPattern.GetVisibleText

Return Type

A string

IMPORTANT

This method is available only if you implement the Text pattern in an object in your application.

Back to top

GetWindowInteractionState Method

Description

Retrieves the interaction state of the window.

Syntax

object.WindowPattern.GetWindowInteractionState

Return Type

Integer.

Possible Values: 

0 = Running. Indicates that the window is running. This does not guarantee that the window is responding or ready for user interaction.

1 = Closing. Indicates that the window is closing.

2 = ReadyForUserInteraction. Indicates that the window is ready for user interaction.

3 = BlockedByModalWindow. Indicates that the window is blocked by a modal window.

4 = NotResponding. Indicates that the window is not responding.

IMPORTANT

This method is available only if you implement the Window pattern in an object in your application.

Back to top

GetWindowVisualState Method

Description

Retrieves the visual state of the window.

Syntax

object.WindowPattern.GetWindowVisualState

Return Type

Integer.

Possible Values: 

0 - Normal (restored)

1 - Maximized

2 - Minimized

IMPORTANT

This method is available only if you implement the Window pattern in an object in your application.

Back to top

Invoke Method

Description

Invokes the action of a control, such as a button click.

Syntax

object.InvokePattern.Invoke

Return Type

None

IMPORTANT

This method is available only if you implement the Invoke pattern in an object in your application.

Back to top

IsMaximized Property

Description

Indicates whether the window is maximized at present.

Syntax

object.WindowPattern.IsMaximized

Return Type

A value of Boolean type.

IMPORTANT

This property is available only if you implement the Window pattern in an object in your application.

Back to top

IsMinimized Property

Description

Indicates whether the window is minimized at present.

Syntax

object.WindowPattern.IsMinimized

Return Type

A value of Boolean type.

IMPORTANT

This property is available only if you implement the Window pattern in an object in your application.

Back to top

IsModal Property

Description

Indicates whether the window is modal.

Syntax

object.WindowPattern.IsModal

Return Type

A Boolean type value.

IMPORTANT

This property is available only if you implement the Window pattern in an object in your application.

Back to top

IsReadOnly Property

Description

Indicates whether the value of the control is read-only.

Syntax

object.ValuePattern.IsReadOnly

object.RangeValuePattern.IsReadOnly

Return Type

A value of Boolean type.

IMPORTANT

This property is available only if you implement the Value or RangeValue pattern in an object in your application.

Back to top

IsSelected Property

Description

Indicates whether an object is selected.

Syntax

object.SelectionItemPattern.IsSelected

Return Type

A value of Boolean type.

IMPORTANT

This property is available only if you implement the SelectionItem pattern in an object in your application.

Back to top

IsSelectionRequired Property

Description

Gets a value that specifies whether the container requires at least one child item to be selected.

Syntax

object.SelectionPattern.IsSelectionRequired

Return Type

A value of Boolean type.

IMPORTANT

This property is available only if you implement the Selection pattern in an object in your application.

Back to top

IsTopMost Property

Description

Indicates whether the window is set to always be displayed in front of other windows, even when it's not the active window.

Syntax

object.WindowPattern.IsTopMost

Return Type

A value of Boolean type.

IMPORTANT

This property is available only if you implement the Window pattern in an object in your application.

Back to top

Maximize Method

Description

Enlarges the window to full screen size. This sets the window's visual state to 1.

Syntax

object.WindowPattern.Maximize

Return Type

None

IMPORTANT

This method is available only if you implement the Window pattern in an object in your application.

Back to top

Minimize Method

Description

Reduces the window to an icon. This sets the window's visual state to 2.

Syntax

object.WindowPattern.Minimize

Return Type

None

IMPORTANT

This method is available only if you implement the Window pattern in an object in your application.

Back to top

PerformDefaultOperation Method

Description

Performs the default operation on the control.

Syntax

object.LegacyIAccessiblePattern.PerformDefaultOperation

Return Type

None

IMPORTANT

This method is available only if you implement the LegacyIAccessible pattern in an object in your application.

Back to top

RemoveFromSelection Method

Description

Deselects the current item.

Syntax

object.SelectionItemPattern.RemoveFromSelection

Return Type

None

IMPORTANT

This method is available only if you implement the SelectionItem pattern in an object in your application.

Back to top

Restore Method

Description

Restores the window to its previous size. This sets the window's visual state to 0.

Syntax

object.WindowPattern.Restore

Return Type

None

IMPORTANT

This method is available only if you implement the Window pattern in an object in your application.

Back to top

Scroll Method

Description

Scrolls the visible region of the content area horizontally and vertically.

Syntax

object.ScrollPattern.Scroll horiztonalAmount, verticalAmount

Arguments

ParameterDescription
horizontalAmount

Required. A predefined value.

The horizontal direction and increment size to use for the scroll. 

Possible values:

  • 0 = LargeDecrement. Move the scroll bar one large step to the left
  • 1 = SmallDecrement. Move the scroll bar one small step to the left
  • 2 = NoAmount. Do not move the scroll bar horizontally.
  • 3 = LargeIncrement. Move the scroll bar one large step to the right
  • 4 = SmallIncrement. Move the scroll bar one small step to the right
verticalAmount

Required. A predefined value.

The vertical direction and increment size to use for the scroll.

Possible values:

  • 0 = LargeDecrement. Scroll one large step upwards
  • 1 = SmallDecrement. Scroll one small upwards
  • 2 = NoAmount. Do not move the scroll bar vertically.
  • 3 = LargeIncrement. Scroll one large step downwards
  • 4 = SmallIncrement. Scroll one small step downwards

Return Type

None

IMPORTANT

This method is available only if you implement the Scroll pattern in an object in your application.

Large steps are equivalent to PageUp/PageDown or clicking on a blank part of a scroll bar. If these are not relevant to the control, a large step is an amount equal to the current visible window.

Small steps are equivalent to pressing an arrow key or clicking the arrow button on a scroll bar.

Back to top

ScrollHorizontal Method

Description

Scrolls the visible region of the content area horizontally.

Syntax

object.ScrollPattern.ScrollHorizontal horiztonalAmount

Arguments

ParameterDescription
horizontalAmount

Required. A predefined value.

The horizontal direction and increment size to use for the scroll. 

Possible values:

  • 0 = LargeDecrement. Move the scroll bar one large step to the left
  • 1 = SmallDecrement. Move the scroll bar one small step to the left
  • 2 = NoAmount. Do not move the scroll bar horizontally.
  • 3 = LargeIncrement. Move the scroll bar one large step to the right
  • 4 = SmallIncrement. Move the scroll bar one small step to the right

Return Type

None

IMPORTANT

This method is available only if you implement the Scroll pattern in an object in your application.

Large steps are equivalent to PageUp/PageDown or clicking on a blank part of a scroll bar. If these are not relevant to the control, a large step is an amount equal to the current visible window.

Small steps are equivalent to pressing an arrow key or clicking the arrow button on a scroll bar.

Back to top

ScrollIntoView Method

Description

Scrolls an item in a scrollable view into view.

Syntax

object.ScrollItemPattern.ScrollIntoView

Return Type

None

IMPORTANT

This method is available only if you implement the ScrollItem pattern in an object in your application.

Back to top

ScrollIntoView Method

Description

Scrolls a text control to bring the specified area into view.

Syntax

object.TextPattern.ScrollIntoView(numberOfUnits, [unitType], [Direction], [Alignment])

Arguments

ParameterDescription
numberOfUnits

An integer. The number of text units to scroll.

unitType

Optional. The text unit type.

Possible values:

  • 0: TextUnit_Line (default)

  • 1: TextUnit_Page

Direction

Optional. The direction in which to scroll.

Possible values:

  • 0: Direction_Forward (default)

  • 1: Direction_Backward

Alignment

Optional. Indicates whether to display the text on the top or bottom of the object.

Possible values:

  • 0: Alignment_Top (default)

  • 1: Alignment_Bottom

Return Type

None

IMPORTANT

  • Make sure the parameters you provide do not attempt to scroll beyond the beginning or end of the document, unless your application specifically allows such scrolling.

  • The scrolling starts from the beginning of the object and can continue beyond the object. For example, when called on a UIAProEdit object, you can scroll 50 lines backwards, into previous UIAPro objects.

  • This method is available only if you implement the Text pattern in an object in your application.

Back to top

ScrollVertical Method

Description

Scrolls the visible region of the content area vertically.

Syntax

object.ScrollPattern.ScrollVertical verticalAmount

Arguments

ParameterDescription
verticalAmount

Required. A predefined value.

The vertical direction and increment size to use for the scroll.

Possible values:

  • 0 = LargeDecrement. Scroll one large step upwards
  • 1 = SmallDecrement. Scroll one small upwards
  • 2 = NoAmount. Do not move the scroll bar vertically.
  • 3 = LargeIncrement. Scroll one large step downwards
  • 4 = SmallIncrement. Scroll one small step downwards

Return Type

None

IMPORTANT

This method is available only if you implement the Scroll pattern in an object in your application.

Large steps are equivalent to PageUp/PageDown or clicking on a blank part of a scroll bar. If these are not relevant to the control, a large step is an amount equal to the current visible window.

Small steps are equivalent to pressing an arrow key or clicking the arrow button on a scroll bar.

Back to top

Select Method

Description

Selects the specified text in the object.

Syntax

object.TextPattern.Select(startIndex, length)

Arguments

ParameterDescription
startIndex

Integer. The text position from which the selection begins. The value is zero-based.

length

Integer. Optional. The number of characters to be selected.

If this parameter is not specified, all remaining text will be selected.

Return Type

None

IMPORTANT

This method is available only if you implement the Text pattern in an object in your application.

Back to top

Select Method

Description

Deselects any selected items and then selects the current item.

Syntax

object.SelectionItemPattern.Select

Return Type

None

IMPORTANT

This method is available only if you implement the SelectionItem pattern in an object in your application.

Back to top

Select Method

Description

Selects the element.

Syntax

object.LegacyIAccessiblePattern.Select(SelectOptions selectionOptions)

Arguments

ParameterDescription
selectionOptions

The flag to use when selecting the element.

Return Type

None

IMPORTANT

This method is available only if you implement the LegacyIAccessible pattern in an object in your application.

Back to top

SelectAll Method

Description

Selects all of the object’s text.

Syntax

object.TextPattern.SelectAll

Return Type

None

IMPORTANT

This method is available only if you implement the Text pattern in an object in your application.

Back to top

SelectCell Method

Description

Selects a cell in the grid.

Syntax

object.GridPattern.SelectCell rowIndex, columnIndex

Arguments

ParameterDescription
rowIndex

Required. An integer.

The cell row index.

columnIndex

Required. An integer.

The cell column index.

Return Type

None

IMPORTANT

This method is available only if you implement the Grid pattern in an object in your application.

Back to top

SetCellValue Method

Description

Sets the specified cell’s value using the Value pattern.

Syntax

object.GridPattern.SetCellValue(int rowIndex, int columnIndex, string cellValue)

Arguments

ParameterDescription
rowIndex

Required. An integer.

The cell row index.

columnIndex

Required. An integer.

The cell column index.

cellValueThe value to be set for the specified cell.

Return Type

None

IMPORTANT

This method is available only if you implement the Grid pattern in an object in your application.

Back to top

SetHorizontalScrollPercent Method

Description

Sets the horizontal scroll position as a percentage of the total content area within the automation element.

Syntax

object.ScrollPattern.SetHorizontalScrollPercent horiztonalPercent

Arguments

ParameterDescription
horizontalPercent

Required. A Double value.

The percentage of the total horizontal content area.

Return Type

None

IMPORTANT

  • This method is available only if you implement the Scroll pattern in an object in your application.

  • This method is only useful when the content area of the object is larger than the visible region of the object.

Back to top

SetScrollPercent Method

Description

Sets the horizontal and vertical scroll position as a percentage of the total content area within the automation element.

Syntax

object.ScrollPattern.SetScrollPercent horiztonalPercent, verticalPercent

Arguments

ParameterDescription
horizontalPercent

Required. A Double value.

The percentage of the total horizontal content area.

verticalPercent

Required. A Double value.

The percentage of the total vertical content area.

Return Type

None

IMPORTANT

  • This method is available only if you implement the Scroll pattern in an object in your application.

  • This method is only useful when the content area of the object is larger than the visible region of the object.

Back to top

SetValue Method (LegacyIAccessible)

Description

Sets the Microsoft Active Accessibility value for the current object.

Syntax

object.LegacyIAccessiblePattern.SetValue(string valueToSet)

Return Type

None

IMPORTANT

This method is available only if you implement the LegacyIAccessible pattern in an object in your application.

Back to top

SetValue Method

Description

Sets the current value of the UI Automation object.

Syntax

object.RangeValuePattern.SetValue (double valueToSet)

Return Type

None

IMPORTANT

This method is available only if you implement the RangeValue pattern in an object in your application.

Back to top

SetSecureValue Method

Description

Sets the encoded Microsoft Active Accessibility value for the current object.

Syntax

object.LegacyIAccessiblePattern.SetSecureValue Text

Arguments

ParameterDescription
Text

Required. A string.

The encoded value to set.

Return Type

None

IMPORTANT

  • This method is available only if you implement the LegacyIAccessible pattern in an object in your application.

  • The encoded text you specify is decoded during the test run.

  • To find the encoded value to use as the argument for the this method, do one of the following: 

    • Use the Password Encoder utility (available from the Windows Start menu).

    • Parameterize the argument using a Data Table parameter and use the Data Table encryption option (right-click each unencrypted value in the password column and choose Data > Encrypt).

    For more information, refer to the UFT One User Guide.

  • While the SetSecureValue method enables you to hide passwords on the screen during a run session, it is not intended to be a secure way to protect password information.

Back to top

SetSecureValue Method

Description

Sets the encoded value of the UI Automation element.

Syntax

object.ValuePattern.SetSecureValue Text

Arguments

ParameterDescription
Text

Required. A string. The encoded value to set.

Return Type

None

IMPORTANT

  • This method is available only if you implement the Value pattern in an object in your application.

  • The encoded text you specify is decoded during the test run.

  • To find the encoded value to use as the argument for the this method, do one of the following: 

    • Use the Password Encoder utility (available from the Windows Start menu).

    • Parameterize the argument using a Data Table parameter and use the Data Table encryption option (right-click each unencrypted value in the password column and choose Data > Encrypt).

    For more information, refer to the UFT One User Guide.

  • While the SetSecureValue method enables you to hide passwords on the screen during a run session, it is not intended to be a secure way to protect password information.

Back to top

SetValue Method

Description

Sets the value of the UI Automation element.

Syntax

object.ValuePattern.SetValue valueToSet

Arguments

ParameterDescription
valueToSet

Required. A string.

The value to set.

Return Type

None

IMPORTANT

This method is available only if you implement the Value pattern in an object in your application.

Back to top

SetVerticalScrollPercent Method

Description

Sets the vertical scroll position as a percentage of the total content area within the automation element.

Syntax

object.ScrollPattern.SetVerticalScrollPercent verticalPercent

Arguments

ParameterDescription
verticalPercent

Required. A Double value.

The percentage of the total vertical content area.

Return Type

None

IMPORTANT

  • This method is available only if you implement the Scroll pattern in an object in your application.

  • This method is only useful when the content area of the object is larger than the visible region of the object.

Back to top

Toggle Method

Description

Cycles through the toggle states of the control.

Syntax

object.ToggleValuePattern.Toggle

Return Type

None

IMPORTANT

This method is available only if you implement the Toggle pattern in an object in your application.

Back to top

WaitForInputIdle Method

Description

Waits until the window is ready for input or the timeout expires.

Syntax

object.WindowPattern.WaitForInputIdle milliseconds

Arguments

ParameterDescription
milliseconds

Required. An Integer.

The number of milliseconds to wait for the object to become ready.

Return Type

None

IMPORTANT

This method is available only if you implement the Window pattern in an object in your application.

Back to top

See also: