webdriverextentreports

ExtentHtmlReporter class can't be imported with extentreports 5.0.6 version


I get Cannot resolve symbol 'ExtentHtmlReporter' message for

com.aventstack.extentreports.reporter.ExtentHtmlReporter;

I added below dependency and I was able to import below imports successfully.

import com.aventstack.extentreports.ExtentTest;
import com.aventstack.extentreports.Status;
import com.aventstack.extentreports.reporter.configuration.Theme;

However, below import is not listed.

import com.aventstack.extentreports.reporter.ExtentHtmlReporter;



 <!-- https://mvnrepository.com/artifact/com.aventstack/extentreports -->
  <dependency>
      <groupId>com.aventstack</groupId>
      <artifactId>extentreports</artifactId>
      <version>5.0.6</version>
  </dependency

I used 5.0.0 too bit no avail. enter image description here


Solution

  • Found the answer in https://sqa.stackexchange.com/questions/46834/unable-to-import-extenthtmlreporter-for-the-java-class

    ExtentHtmlReporter, ExtentLoggerReporter The ExtentHtmlReporter and ExtentLoggerReporter were deprecated in series 4.1.x and have been removed in version 5. The replacement is ExtentSparkReporter, which is comprehensive, ports all features along with a host of new ones.

    ExtentSparkReporter spark = new ExtentSparkReporter("Spark.html");

    Or downgrade to 4.0.9