AutomationElement.GetRuntimeId Method

Retrieves the unique identifier assigned to the user interface (UI) item.

Namespace: System.Windows.Automation
Assembly: UIAutomationClient (in uiautomationclient.dll)

public int[] GetRuntimeId ()
public int[] GetRuntimeId ()
public function GetRuntimeId () : int[]
Not applicable.

Return Value

An array of integers representing the run-time identifier.

Exception typeCondition


The UI for the AutomationElement no longer exists.

The identifier is only guaranteed to be unique to the UI of the desktop on which it was generated. Identifiers can be reused over time.

The format of run-time identifiers might change in future releases. The returned identifier should be treated as an opaque value and used only for comparison; for example, to determine whether an AutomationElement is in the cache.

The following example shows how to retrieve the run-time identifier of an AutomationElement.

// element is an AutomationElement.
int[] id = element.GetRuntimeId();

Windows 98, Windows Server 2000 SP4, Windows CE, Windows Millennium Edition, Windows Mobile for Pocket PC, Windows Mobile for Smartphone, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition

The Microsoft .NET Framework 3.0 is supported on Windows Vista, Microsoft Windows XP SP2, and Windows Server 2003 SP1.

.NET Framework

Supported in: 3.0

Community Additions