Monday, October 13, 2008

Selenium tip of the day: assertXpathCount

For those of you (like me) learning some Selenium IDE commands, here's a tip that Ben showed me today: assertXpathCount. The other day, Abra and I were trying to assert that a certain column in a table contained the same value. Ben noted another way to specifically check the count of something in a page using assertXpathCount. So if I wanted to assert that Roger's name appears in a column (any cell with a particular class) three times, I'd use the assertXpathCount command and the following arguments:

  • Target:
    //td[@class="presenter" and contains(text(),"Roger")]
  • Value:
    3

No comments: