Skip to main content

Element Editing and Validating: Advanced Tuning for Stability

Learn to refine locators using visual editors or Custom XPath, integrate dynamic variables, and validate elements to ensure long-term workflow stability.

Sophie avatar
Written by Sophie
Updated this week

Entry Points for Editing Elements

Depending on your software version, you can access the element editor through the following methods:

For v2.0 (Enhanced):

  • Direct Click: Within the flow canvas, find the command and click the element name directly to enter the editing interface.

  • Dropdown Menu: Click the downward arrow next to the element name in the command and select "Edit."

  • Element Library: In the Element Library (right-hand panel), you can either double-click or right-click and select "Edit" to modify the element.

For v1.0:

  • Hover Edit: Move your mouse over the element icon within a command, wait for the dropdown, and click "Edit Element."

  • Double-click Edit: In the Element Library, double-click the target element directly.

Choosing Your Editing Interface: Visual vs. Custom

The editor provides two distinct ways to define how the robot "sees" an element, depending on your technical comfort level:

Element Editor (Layered Selector)

  • Operation: Construct positioning conditions by checking specific attributes, operators, and values for each element layer.

  • Best For: Users who prefer a visual, guided approach over manual XPath writing.

Custom XPath

  • Operation: Switch on "Customize XPath". Directly enter or paste a complete XPath expression.

  • Best For: Advanced users who require precise control and high flexibility for complex positioning.

Operational Steps & Validation

Method 1: Using the Element Editor

  1. Expand the element layers one by one.

  2. Select the target attributes, operators, and values for each layer.

  3. The system automatically generates the positioning expression based on your selections.

Method 2: Using Custom XPath

If the visual editor is not precise enough:

  1. Switch to the Customize XPath interface.

  2. Manually write or paste an XPath (e.g., copied from browser Developer Tools).

Validation

Click the Check Element button to verify if the current expression accurately locates the target on the active page.

Note: If multiple identical windows are open, the validation may detect multiple matches.

New in v2.0: Using Variables in Elements

You can make your elements dynamic by inserting variables directly into the locator:

  1. In the Element Editor: Click the {x} icon in the attribute value box to select a variable from the list.

  2. In Custom XPath: Position your cursor at the desired point in the expression and click the {x} icon to insert {variable_name}.


Re-capturing Elements

When an element fails, follow this recovery workflow:

  • Archive Original Path: Copy and keep the original expression temporarily. This allows you to compare it with the new path later to identify what has changed.

  • Re-capture: Use the capture tool to pick the same element again.

  • Compare and Analyze: Compare the old and new paths to identify patterns (e.g., did an ID change or did a list index move from [32] to [45]?).

  • Optimize: Modify the locator based on your analysis to be more resilient, such as replacing a changing index with a stable attribute.

Attribute Selection Principles

When using the visual Element Editor, follow these rules to ensure stability:

  • Avoid Index Dependency: Prioritize unique attributes over positional indexes (avoid [1], [2]).

  • Prioritize Stability: Choose fixed attributes like id, name, or data-testid.

  • Simplify Paths: Skip unnecessary intermediate layers to keep the path concise.

Operator

Use Case

Example

Equals (=)

Values are 100% static and unchanging.

class="btn-primary"

Contains

Values are partially fixed but contain dynamic parts.

class contains "btn-"

Starts-with

The beginning of the value is always consistent.

id starts with "user_"

Ends-with

The end of the value is always consistent.

name ends with "_input"

Did this answer your question?