Selenium IDE -- Get count of rows for table within a div tag?

114 views
Skip to first unread message

Shawn Eingle

unread,
Jun 27, 2016, 12:34:48 PM6/27/16
to Selenium Users
Could use some assistance here re: how to properly count rows of a table within a div tag.  Here is the example html:

<div id="tabscroller">
<table>
    <tbody>
        <tr><td>text</td></tr>
        <tr><td>text</td></tr>
        <tr><td>text</td></tr>
   </tbody>
</table>
</div>


Trying to capture the row count using the storeXpathcount function;  see log output below:
  • [info] Executing: |storeXpathCount | //div[@id='tabscroller']/table/tbody/tr | z |
  • [info] Executing: |echo | ${z} | |
  • [info] echo: 0 
From the Selenium IDE UI, the "Find" function does locate the first row of the desired table using the xpath above.  This seems to align with all the examples I've come across, so I'm not understanding why it's not returning the expected count.  Also, just to confirm Xpath was appropriate, I tested uisng the storeElementIndex function and did get the expected results (e.g. passing //div[@id='tabscroller']/table/tbody/tr[3]  returned expected value of 2).  

Any suggestions appreciated!
Reply all
Reply to author
Forward
0 new messages