# How to Data-Drive Xpaths

In some scenarios, an accessor’s XPath must be generated dynamically from test data. Scenario Editor supports data-driven XPath expressions by allowing variables within the XPath expression.

```
byXPath("//*[@id='" + $Test + "']")
```

The `<span class="editor-theme-code">$Test</span>` variable is replaced with the corresponding test-data value when the step executes.

---

Last updated: October 15, 2026

If you have any feedback on this topic, please contact us at <documentation@appvance.ai>.