The page has 3 buttons with a certain text {text}. I want to be able to click on the first such button.
I tested an xpath on chrome console with the index and that gives out the correct button.
$x("//button[contains(text(), 'sometext')]")[0]
But when I use the exact same xpath as a selector in my nightwatch code, it doesn't seem to find it.
Whereas
selector: '//button[contains(text(), "sometext")]'
does seem to find 3 buttons but when I add [0] (as above) it fails to find the element.