public static void assertTrue(String message, boolean condition)
AssertionError
with the given message.
分析:
示例:
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”。
message
- the identifying message for the AssertionError
(null
okay)condition
- condition to be checkedpublic static void assertTrue(boolean condition)
AssertionError
without a message.
condition
- condition to be checked原文:http://www.cnblogs.com/woniu123/p/6363211.html