Skip to main content

Get Selected Item

Reads the currently selected item from a combobox, list or tree via the UIA SelectionPattern (Windows only). Returns the selected item's name; multi-selects are joined with newlines.

Category: Desktop Application Automation · Group: Desktop · Activity name: GetSelectedItem

The GetSelectedItem activity in the designer

Example

outputVariable = GetSelectedItem("<xPath>", checkOrphanedElements=False)

Inputs

NameTypeRequiredDefaultDescription
XPathstringYesXPath expression that identifies the target element.
Check orphaned elementsbooleanFalseWhen the element is not found by its XPath, scan the parent window's area for elements detached from the UI Automation tree. Slower; enable only for windows known to orphan their elements.

Outputs

NameTypeDescription
outputVariablestringSpecifies the name of the variable that will store the selected item's name.