开发者

Selenium SeleniumTestCase .checkForVerificationErrors method : output status before it fails

开发者 https://www.devze.com 2023-01-07 10:20 出处:网络
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

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 开发者_StackOverflowwhich row and columns error was detected as checkForVerificationErrors method will fail immediately without letting me to output any debugging information.


You can use the JUnit TestCase assertions instead:

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

精彩评论

暂无评论...
验证码 换一张
取 消