title: how to count number of td/tr in a table with Robot Framework using Selenium2Library
body: <p>I am using Robot Framework to automatically check the number of TDs or TRs in a table.</p>
  
  <p>I am using Get Matching XPath Count keyword from Selenium, however, it always fails with an error.</p>
  
  <p>My sample HTML structure:</p>
  
  <pre><code>&lt;table id="myTable"&gt;
    &lt;tr&gt;
        &lt;td style="width: 50%"&gt;my td&lt;/td&gt;
        &lt;td style="width: 50%"&gt;my td&lt;/td&gt;
    &lt;/tr&gt;
  &lt;tr&gt;
        &lt;td style="width: 50%"&gt;my td&lt;/td&gt;
        &lt;td style="width: 50%"&gt;my td&lt;/td&gt;
    &lt;/tr&gt;
  &lt;tr&gt;
        &lt;td style="width: 50%"&gt;my td&lt;/td&gt;
        &lt;td style="width: 50%"&gt;my td&lt;/td&gt;
    &lt;/tr&gt;
  &lt;tr&gt;
        &lt;td&gt;Search me&lt;/td&gt;
        &lt;td&gt;Pagination here&lt;/td&gt;
    &lt;/tr&gt;
  &lt;/table&gt;
  </code></pre>
  
  <p>I am using the keyword with XPath : .//[@id='myTable']/tr/td/@width</p>
  
  <p>Because I just want to count td with a "width" attribute.</p>
  
  <p>and the error: InvalidSelectorException: Message: u"invalid selector: Unable to locate an element with the XPath expression...</p>
  
  <p>Any solution?
  thanks</p>