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
Example:
$x("//button[text() ='Submit']")
When this command is entered it will return all occurrences of elements that are buttons with text equal to Submit.