如何将脚本标记为失败但不中止在Selenium中执行当前测试用例?
@Test
public void testCase() {
System.out.println("line 1 printed");
Assert.assertTrue(false);
System.out.println("i want to execute this line after failure");
}
答案 0 :(得分:1)
使用routesGenerator := StaticRoutesGenerator
test-ng
我怀疑SoftAssert softAssert = new SoftAssert();
@Test
public void testCase() {
System.out.println("line 1 printed");
softAssert.assertTrue(true);
softAssert.assertEquals("India", "US");
softAssert.assertTrue(false);
System.out.println("i want to execute this line after failure");
softAssert.assertAll();
}
仍未提供此类功能。