Checkout our demo site to practice selenium https://magento.softwaretestingboard.com/

0 like 0 dislike
4.4k views
by The go-to Tester (222 points)
I am getting below error while executing my tests.

com.relevantcodes.extentreports.ExtentTestInterruptedException: Close was called before test could end safely using EndTest.

I have already removed any .close() sentence and also I tried using report.endTest(test); at the end of the test.

Still, I am facing the same issue.

3 Answers

0 like 0 dislike
by The go-to Tester (222 points)
In your TestNG suite, use @AfterSuite as below.

@AfterTest
protected void afterSuite() {
    super.getReport().endTest(super.getLogger());
    super.getReport().flush();
}
0 like 0 dislike
by
Remove extent.startTest("TestCaseName", "Description");
0 like 0 dislike
by
add below:
@AfterTest
public void teardown(){

driver.close();
extent.flush();

}


This site is for software testing professionals, where you can ask all your questions and get answers from 1300+ masters of the profession. Click here to submit yours now!

...