Using Attributes to Identify an Object

This functionality is supported only if you are using the Open Agent.

To identify an object based on its properties, you can use locator attributes. The locator attributes are specified in square brackets after the type of the object.

Example

The following sample uses the textContents attribute to identify a hyperlink with the text Home. If there are multiple hyperlinks with the same text, the locator identifies the first one.

WINDOW link = WebBrowser.BrowserWindow.Find("//a[@textContents='Home']")