Using the Find Method

Instead of using methods like .DomLink, you can use the Find method to identify a single object with a locator.

Note: The Find method can only use full locators, the shortened locator form is not supported.

Instead of typing:

VB

_desktop.DomLink("//a[@textContents='Home']").Select()

C#

_desktop.DomLink("//a[@textContents='Home']").Select();

you can type:

VB

_desktop.Find(Of DomLink)("//a[@textContents='Home']").Select()

C#

_desktop.Find<DomLink>("//a[@textContents='Home']").Select();

The .DomLink method also uses the Find method internally. Prefer using the .DomLink method, because it is more concise than the Find method.