The xBrowser technology domain supports dynamic object recognition.
Test cases use locator strings to find and identify objects. A typical locator includes a locator name and at least one locator
attribute, such as
"//LocatorName[@locatorAttribute='value']".
- Locator Names
-
With other technology types, such as Java SWT, locator names are created using the class name of the test object. With xBrowser,
the tag name of the DOM element can also be used as locator name. The following locators describe the same element:
- Using the tag name:
"//a[@href='https://www.microfocus.com']"
- Using the class name:
"//DomLink[@href='https://www.microfocus.com']"
To optimize replay speed, use tag names rather than class names.
- Locator Attributes
- All DOM attributes can be used as locator string attributes. For example, the element
<button automationid='123'>Click Me</button> can be identified using the locator
"//button[@automationid='123']".
- Recording Locators
- Silk4J uses a built-in locator generator when recording test cases and using the
Identify Object dialog box. You can configure the locator generator to improve the results for a specific application.