title: Selecting nth child in selenium
body: <p>At first my question was about why I get "Element //table[2] not found" error while selecting the second of 2 tables. Xpaths that didn't work (using <em>assertElementPresent</em> function):</p>
  
  <pre><code>//table[2]
  (//table)[2] (here I got error for wrong xpath)
  //table[position()=2]
  //table[last()] (here I got the first table)
  </code></pre>
  
  <p>But finally I've found the answer</p>
  
  <pre><code>$this-&gt;assertElementPresent("xpath=(//table)[2]");
  </code></pre>
  
  <p>So now my question is why does the last statement work while others not? And why</p>
  
  <pre><code>$this-&gt;assertElementPresent("//table[1]");
  </code></pre>
  
  <p>works as it is whitout <em>xpath=...</em>?</p>
  
  <p>PHP 5.5.7, PHPUnit 3.8, Selenium 2.37.0, MacOS 10.9.1</p>