Extent report error | Selenium Forum
M
Posted on 01/12/2016
Hi,

I am using Java 1.7, ansd ExtentReport version:2.40.1. I am getting an error at this line: extent = new ExtentReports("file-path", true, displayOrder);

The error is: java.lang.NoSuchFieldError: VERSION_2_3_23

Can you please suggest what I am doing wrong?

Thanks,

Rezaul

M
Replied on 02/12/2016

Please post your code once
Attach your java file


M
Replied on 02/12/2016

The problem is : it can not create an instance of ExtentReports and the issue is in:
extent = new ExtentReports("//Users//raziz//Reporting//"+fileName, true, DisplayOrder.NEWEST_FIRST);


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("//Users//raziz//Reporting//"+fileName, true, DisplayOrder.NEWEST_FIRST);
extent.loadConfig(new File(System.getProperty("user.dir")+"//ReportsConfig.xml"));
extent.addSystemInfo("Selenium Version", "2.45.0").addSystemInfo("Environment", "DEV");


}
return extent;
}
}

ReportsConfig.xml file:

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

<!-- document encoding -->
<!-- defaults to UTF-8 -->
<encoding>UTF-8</encoding>

<!-- protocol for script and stylesheets -->
<!-- defaults to https -->
<protocol>https</protocol>

<!-- title of the document -->
<documentTitle>Automation Report</documentTitle>

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

<!-- report headline - displayed at top-nav, after reportHeadline -->
<reportHeadline>Headline 1</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>


M
Replied on 05/12/2016

Can anyone please help?

Thanks


M
Replied on 06/12/2016

Never mind. Resolved the issue.

Thx


M
Replied on 09/12/2016

OK