title: XPath Error in Mink: Failed to execute 'evaluate' on 'Document': The result is not a node set, and therefore cannot be converted to the desired type
body: <p>I'm using Mink and the Selenium2 Driver with Behat to run some acceptance tests and for the most part, everything is going well.</p>
  
  <p>However, I'm trying to target an element based on a data-* attribute with XPath, and the test chokes on it.</p>
  
  <p>I've used XPathHelper and FirePath and my XPath checks out in both of those extensions:</p>
  
  <p><code>//html//@data-search-id='images'</code></p>
  
  <p>That appears to target the correct element.</p>
  
  <p>However, when I add the following to FeatureContext.php</p>
  
  <pre><code>$el = $this-&gt;getSession()-&gt;getPage()-&gt;find('xpath', $this-&gt;getSession()-&gt;getSelectorsHandler()-&gt;selectorToXpath('xpath', "//@data-search-id='images'"));
  $el-&gt;click();
  </code></pre>
  
  <p>I get the following error from Behat:</p>
  
  <pre><code>invalid selector: Unable to locate an element with the xpath expression
  //html//@data-search-id='images' because of the following error:
  
  TypeError: Failed to execute 'evaluate' on 'Document':
  The result is not a node set, and therefore cannot be converted
  to the desired type.
  </code></pre>