xpath Getting started with xpath Testing Xpaths in browser console


A quick way to test your xpath is in your browser developer tool console.

Format is

   $x('//insert xpath here')

$ - specifies it is a selector.

x - specifies it is using xpaths


$x("//button[text() ='Submit']")

When this command is entered it will return all occurrences of elements that are buttons with text equal to Submit.