Skip to content

Not able to create object of ExtentReports

I am new to extent reporting. I am using Selenium Webdriver and want to use Extent reports with it.

But my code is not able to create ExtentReport object.

package com.code.draft;

import org.openqa.selenium.WebDriver;
import org.openqa.selenium.firefox.FirefoxDriver;

import com.relevantcodes.extentreports.ExtentReports;
import com.relevantcodes.extentreports.ExtentTest;
import com.relevantcodes.extentreports.LogStatus;

public class TestReport {

    ExtentReports reports;
    ExtentTest logger; 
    WebDriver driver;

    public void start(){        
        reports = new ExtentReports("C:\User\Test\Report\Report.html"); //Exception at this line reports object = null
        driver = new FirefoxDriver();
        logger = reports.startTest("Verify Title");
        logger.log(LogStatus.INFO, "Starting Browser");

    public static void main(String[] args) {
        TestReport report = new TestReport();


The above code is giving exception as :

Exception in thread "main" java.lang.NoSuchFieldError: VERSION_2_3_23
    at com.relevantcodes.extentreports.HTMLReporter.start(
    at com.relevantcodes.extentreports.Report.attach(
    at com.relevantcodes.extentreports.ExtentReports.<init>(
    at com.relevantcodes.extentreports.ExtentReports.<init>(
    at com.code.draft.TestReport.start(
    at com.code.draft.TestReport.main(

Using the below configuration :


if anyone have idea. Please help.



I tested your code. It shows no exception at my end. But to get your HTML report you need to flush using reports.flush() just before reports.endTest(logger);.