0

I'm trying generate reports for the selenium test script. but unable import "ExtentHtmlReporter" packages to the class.

enter image description here

added dependencies as below

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

and extent-config.xml file as below

<?xml version="1.0" encoding="UTF-8"?>
<extentreports>
<configuration>
<!-- report theme --> <!-- standard, dark --> 
<theme>standard</theme>

<!-- document encoding --> <!-- defaults to UTF-8 --> 
<encoding>UTF8</encoding>
    
<!-- protocol for script and stylesheets --> <!-- defaults to https --> 
<protocol>https</protocol>

<!-- title of the document --> 
<documentTitle>ExtentReports 2.0</documentTitle>

<!-- report name - displayed at top-nav --> 
<reportName></reportName>

<!-- report headline - displayed at top-nav, after reportHead- line -->
<reportHeadline>Automation Report</reportHeadline>

<!-- global date format override --> <!-- defaults to yyyy-MM-dd--> 
<dateFormat>yyyy-MM-dd</dateFormat>

<!-- global time format override -->
<!-- defaults to HH:mm:ss -->
<timeFormat>HH:mm:ss</timeFormat>

<!-- custom javascript -->
<scripts>
    <![CDATA[ $(document).ready(function() {});]]> 
</scripts>

<!-- custom styles --> 
<styles>
    <![CDATA[]]> 
</styles>
</configuration>
</extentreports>
0
2

https://www.extentreports.com/docs/versions/5/java/index.html

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");
1

Found the solution. Need to downgrade the extent report version. downgraded to 4.0.9 and it works for me

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.