Skip to main content

How to Data-Drive Xpaths

ThereIn couldsome bescenarios, situationsthe whereXPath xpathsused inby myan testaccessor designermay scripts needsneed to be datadynamically driven,generated Howbased on test data. Test Designer supports data-driven XPaths by using variables within the XPath expression.

The following example shows how to achieveuse thea samevariable inas Testpart Designer?of an XPath:

Below code can be used to data drive your scripts that uses accessors as xpaths

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


Last updated: March 09, 2023

If you have any feedback onIn this topic,example, please$Test contactis usreplaced atwith documentation@appvance.aithe value provided by the test data, allowing the same accessor to interact with different elements during test execution.