Skip to content

Latest commit

 

History

History

use-xpath-selectors

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 

Use XPath Selectors

Test Code: index.js

This example shows how to use XPath selectors in TestCafe tests.

The xpath-selector.js file exports a TestCafe selector that takes an XPath string as a parameter. This selector uses a function executed on the client to search for elements that match an XPath expression.

index.js imports this custom selector from xpath-selector.js and uses it to identify page elements with XPath strings.