views:

15

answers:

1

Hi

I am testing a table on a webpage where i need to verify all values in table. For this i have written a for loop something like this

for (row) {
   for (column) {
       SeleniumTestCase.verifyTrue( "expected".equals("obtained"));
   }
   SeleniumTestCase.checkForVerificationErrors();
}

Here in the fifth line i am checking was their any error in any of the columns at this row.

Problem is if their is any error, i can not output at which row and columns error was detected as checkForVerificationErrors method will fail immediately without letting me to output any debugging information.

A: 

You can use the JUnit TestCase assertions instead:

for (row) {
   for (column) {
       SeleniumTestCase.assertEquals("Verifying row " + row + ", column " + column, 
               expected, obtained);
   }
}
ZloiAdun