minkphp/Mink

How to use 'xpath' as locator?

bartonhammond opened this issue · 3 comments

Is it possible to use xpath expressions for like click, or find. I searched the docs and see only one result for xpath.

It's possible for find:

$anchorsWithoutUrl = $page->findAll('xpath', '//a[not(@href)]');

Copied from http://mink.behat.org/en/latest/guides/traversing-pages.html?highlight=xpath .

stof commented

And click is not looking for any element. It clicks on the element on which you call the method (so you need to use find before it)

Ok - thanks