【发布时间】:2018-06-08 06:31:34
【问题描述】:
即使其中一个软断言失败,测试也会继续进行。 但在我的情况下,我的测试在软断言失败后停止,因为找不到下一个测试元素。
softAssert.assertTrue(p.OtsPage.fName().getAttribute("readonly").equals("true"), "field Name is Editable", "field Name is Read Only");
softAssert.assertTrue(p.OtsPage.fEditValue().isEnabled(), "field Edit Value is not Editable", "field Edit Value is Editable");
这可以正常工作,但如果我设置:
softAssert.assertFalse(p.OtsPage.fName().getAttribute("readonly").equals("true"), "field Name is Editable", "field Name is Read Only");
softAssert.assertFalse(p.OtsPage.fEditValue().isEnabled(), "field Edit Value is not Editable", "field Edit Value is Editable");
我收到以下错误消息:
org.openqa.selenium.NoSuchElementException。 第二次软断言!!!
然后测试停止。
环境:Selenium 3.5 + geckodriver + Mozilla 56.0.1。
【问题讨论】:
标签: java selenium firefox assertions geckodriver