0

I'm new to selenium and html, so forgive me if I ask something silly.

I'm using perl. There's a list of links on a sidebar. I have a list of links that should be present in this list once it's entirely expanded. Expanding was easy, i just did while elemnt is present link=[+], then click. I need to see if there are any extra that shouldn't be there. I'm not too sure how to do this. My plan was to compare the size of the list to what I expect it to be, but I'm not sure how to do this either.

Is there a simple way to do that, or perhaps a different way that also works?

  • This appears to be the same as http://stackoverflow.com/questions/1573170/counting-number-of-elements-matching-a-css-selector – Clive Evans Aug 02 '11 at 14:52
  • I tried using selenium.getXpathCount("//div//ul//li"), which works fine in Firefox. The problem is i'm getting very large numbers in IE. Any idea why? – Isaiah balker Aug 02 '11 at 15:51
  • getXpathCount might not work correctly in IE, as IE doesn't support Xpath like firefox. You would need the CSS equivalent for getXpathCount – A.J Aug 02 '11 at 23:08