Skip to content

Get a CSS Selector or XPath

When the browser does not provide a compatible helper extension, obtain a CSS selector or XPath from the Elements panel in browser developer tools and paste it into an RPA Plus element location field.

Open Developer Tools

  1. Open the target page in the browser profile used by the workflow and reproduce the page state where the action occurs.
  2. Right-click the element that the workflow will click, type into, or read.
  3. Click Inspect. The browser opens the Elements panel and selects the corresponding HTML node.
Inspect the target element
Inspect the target element

Confirm that the highlighted HTML node is the intended element. Selecting a parent container or inner icon can make the workflow target the wrong object.

Account names, order numbers, and other business data may appear in HTML attributes or text. Hide sensitive information before capturing a screenshot or sharing a selector.

Copy a Location Value

Right-click the selected HTML node in Elements, open Copy, and select the required value.

Copy a CSS selector or XPath
Copy a CSS selector or XPath
No.ActionDescription
1Copy selectorCopies a CSS selector to paste after selecting CSS Selector in the node
2Copy XPathCopies the browser-generated XPath to paste after selecting XPath
3Copy full XPathCopies an absolute path from the document root. It breaks easily after structural changes and should be a temporary last resort

Names can vary by browser version or UI language, such as Copy selector, Copy XPath, and Copy full XPath.

Validate the Result

Validate that the copied value consistently matches the target:

Validate a selector in developer tools
Validate a selector in developer tools
  1. Press Command + F on macOS or Ctrl + F on Windows in Elements.
  2. Paste the CSS selector or XPath.
  3. Check the match count and highlighted node. A single correct match can generally be used directly.
  4. For multiple matches, configure a fixed index in RPA Plus or make the location more precise.
  5. Paste the value into the corresponding RPA Plus field and debug the node.

Improve Location Stability

Automatically generated values are a starting point and may break after a page update:

  • Prefer CSS selectors with a stable id, name, or data-* attribute.
  • Avoid generated class names, dynamic indexes, and long hierarchy paths.
  • Prefer relative XPath using stable attributes over full XPath.
  • Display dynamic content such as a dialog or dropdown before inspecting and copying it.
  • Revalidate after page structure or login state changes.

See Select a Location Method for selector rules, Select a Matching Element for indexes, and Use a Saved Element Object for element variables.