Extent Reports - ExtentHtmlReporter cannot be resolved to a type | Selenium Forum

Extent Reports - ExtentHtmlReporter cannot be resolved to a type

M
Mamta Bansal Post on 02/02/2020

<dependency>

<groupId>com.relevantcodes</groupId>

<artifactId>extentreports</artifactId>

<version>2.40.1</version>

</dependency>

S

Instructor

Support Team Reply on 03/02/2020

As I can see that you are using the older version of extent reports. 

Please use the below dependency.

<dependency>
	<groupId>com.aventstack</groupId>
	<artifactId>extentreports</artifactId>
	<version>3.1.2</version>
</dependency>

M
Mamta Bansal Reply on 03/02/2020

I m having below Extentmanager.java file in my downloaded code. Can u provide me the latest one which uses aventstack dependency?

package com.qtpselenium.core.ddf.util;

//http://relevantcodes.com/Tools/ExtentReports2/javadoc/index.html?com/relevantcodes/extentreports/ExtentReports.html


import java.io.File;
import java.util.Date;

import com.relevantcodes.extentreports.DisplayOrder;
import com.relevantcodes.extentreports.ExtentReports;

public class ExtentManager {
private static ExtentReports extent;

public static ExtentReports getInstance() {
if (extent == null) {
Date d=new Date();
String fileName=d.toString().replace(":", "_").replace(" ", "_")+".html";
extent = new ExtentReports("D:\\report\\"+fileName, true, DisplayOrder.NEWEST_FIRST);


extent.loadConfig(new File(System.getProperty("user.dir")+"//ReportsConfig.xml"));
// optional
extent.addSystemInfo("Selenium Version", "2.53.0").addSystemInfo(
"Environment", "QA");
}
return extent;
}
}

S

Instructor

Support Team Reply on 04/02/2020

In this case are you including all the required files? Extent Reports for this version needed a configuration file as well.

Please refer to the module video clearly and look for the same files in the downloaded code. This will help you in working with extent reports.

 

I case you want to use the latest version of Extent Reports, then you can refer Module 24, we have covered in detail how we can use Newer Extent Reports and how we can generate our own Extent Manager.