View All Elements to Target
If a robot failed during testing, you might need to target a different selector.
- Open a robot.
- In the navigation pane, select Projects.
- Select the project name.
- In the left toolbar, select Robot
.
- In the Robots box, select the
robot to open.
The canvas appears.
- Open the targeting tool for a robot action.
- On the canvas, double-click the action to update.
- Click within the Locator field, and select
Target a page element
.
The Target a page element panel appears.
- In the panel, from the Select browser tab to target drop-down, select the application where the robot works, and select Go. You might need to scroll down to find the application.
- In the Targeting On window in the lower-left corner of your browser, select
Settings.
The Settings panel appears.
- In the Settings panel, select Select from various generated selectors, and close the Settings panel.
- Point to a UI element that the robot needs to work in, and after the icon
changes to a target and the shading turns green, select the UI element.
The Target Element panel appears. This panel lists all the possible XPaths and other elements that you can target for the selected component.
- Identify the selector to target.
Targeting strategy Beginning of the selector value When to use the targeting strategy Relative XPath expressions
(Default selection for the recorder)
xpath://
Most robots run successfully when you use this targeting strategy, which requires a UI element's target value to be the same in every session. This strategy identifies the element's ID, as shown below. To view this dialog: In the horizontal toolbar on the right, select Targets
, and then select Edit
.
To determine whether this strategy will work for a UI element, check the UI element's target in a regular browser and then an incognito browser. If the targets match, you can use this targeting strategy.
Tip:
If you are troubleshooting a failed robot and you see@id=
in the Locator field above, you might want to try using a different targeting strategy.Absolute XPath expressions
xpath:/
Use this targeting strategy when a UI element's target value changes from one session to another.
To determine whether a target is dynamic, check the target in a regular and incognito browser session. If the targets are different, the UI element has a dynamic target value.
Relative CSS expressions
css:#
Use this strategy if a robot fails while using the relative and absolute XPath strategies.
Absolute CSS expressions
css:<tag>#
Use this strategy if a robot fails while using any of the other strategies.
- Click Select.
The recorder enters a value in the Locator field in the robot.
The Select from various generated selectors setting remains selected for the duration of your sign-in session.