Junit中AssertTrue方法

转自:https://www.cnblogs.com/woniu123/p/6363211.html

boolean value=webDriver.findElement(By.xpath("......")).isDisplay();
//判断是否显示xx
assertTrue("Failed to go to the Login page", value);

如果value的值是true则运行成功,如果value的值是false则运行失败并打印出信息“Failed to go to the Login page”。

猜你喜欢

转载自blog.csdn.net/weixin_44044395/article/details/112373006
今日推荐