0
点赞
收藏
分享

微信扫一扫

软件测试面试题:SoftAssert的特点,并对软断言进行举例说明?

SoftAssert的特点,并对软断言进行举例说明?

1) 如果一个断言失败,会继续执行这个断言下的其他语句或者断言



2) 调用assertAll()在该用例的最后一个断言后面



3) 软断言的类,叫SoftAssert.java,这个类是需要创建实例对象,才能调用相关实例方法进行软断言



举例

@Test

public void test2() {undefined

System.out.println("Test start"); 

SoftAssert assertion = new SoftAssert(); 

assertion.assertEquals(12, 13,"两者不相等"); 

System.out.println("Test complete"); 

System.out.println(3十8); 

assertion.assertAll(); 

}


个人简介


我是一名测试兼开发工程师,目前25K,目前做的是无人驾驶,欢迎和大家一起交流测试技术,
起高薪就业,我们还有一起打妖怪的群哦,还有面试题小程序哦

举报

相关推荐

0 条评论