2
  1. krGlobalPage.softAssertionTestCall2(softAssertion); has to run even after krGlobalPage.softAssertionTestCall1(softAssertion); is failed due to
Chris
  • 236
  • 4
  • 14

1 Answers1

1

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");
}
Amr El Massry
  • 371
  • 3
  • 4