Question

I want to store the count of li elements in an ul list. The list resides in an frame with the id content frame. I the li elements all contains an anchor tag with class listHead

First i tried this:

<tr>
    <td>storeXpathCount</td>
    <td>//ul/li/a[@class=listHead]</td>
    <td>countMax</td>
</tr>
<tr>
    <td>echo</td>
    <td>${countMax}</td>
    <td>${countMax}</td>
</tr>

The countMax returned is 0. If i change the target to //* i get an xpathCount of only 13. Inspecting the source showed that most of the page is within iframes. So, i tried adding select frame:

<tr>
    <td>selectFrame</td>
    <td>contentFrame</td>
    <td></td>
</tr>
<tr>
    <td>storeXpathCount</td>
    <td>//ul/li/a[@class=listHead]</td>
    <td>countMax</td>
</tr>
<tr>
    <td>echo</td>
    <td>${countMax}</td>
    <td>${countMax}</td>
</tr>

The echo of countMax still returns 0, and if changed to //* 13. How do I get a count of the elements in the frame? I am using Selenium IDE 2.5.0 w. firefox.

Was it helpful?

Solution

It seems like your xpath attribute filter is missing quotes around the class name. Try:

//ul/li/a[@class="listHead"]
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top