Selenium SeleniumTestCase .checkForVerificationErrors方法:失败前的输出状态

时间:2010-07-16 16:09:52

标签: selenium junit4

我在网页上测试一个表格,我需要验证表格中的所有值。 为此我写了一个for循环 像这样的东西

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

我在检查的第五行是他们在这一行的任何列中的任何错误。

问题是如果它们是任何错误,我无法输出检测到哪个行和列错误,因为checkForVerificationErrors方法将立即失败而不让我输出任何调试信息。

1 个答案:

答案 0 :(得分:0)

您可以使用JUnit TestCase断言:

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