如何将脚本标记为失败但不中止在Selenium中执行当前测试用例?

时间:2016-06-07 09:18:03

标签: java

如何将脚本标记为失败但不中止在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");
}

1 个答案:

答案 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(); } 仍未提供此类功能。