Reputation: 236
krGlobalPage.softAssertionTestCall2(softAssertion);
has to run even after krGlobalPage.softAssertionTestCall1(softAssertion);
is failed due toUpvotes: 2
Views: 1595
Reputation: 391
The way that I have found best - and also to show in Allure report as fail - is to try-catch the findelement and in the catch block, set the assertTrue to false, like this:
try {
driver.findElement(By.xpath("(//nav[@class='topline']//nav[@class='without-seperator1']/a)[1]");
}catch(Exception e) {
assertTrue(false, "Test Search link was not displayed");
}
Upvotes: 1