I am not able to generate extent report. please help | Selenium Forum
K
Kapil Kuriakose Posted on 31/10/2019

I have written all the codes correctly as mentioned in the video. kept the jar files in place and XML file as well. but I am getting below error. please help urgently. 

Is there any dependency between the Xslt report and Extent reports? can we have an Extent report alone without XSLT report?

Error:

org.testng.TestNGException:
Cannot instantiate class testcases.RegTest
at org.testng.internal.ObjectFactoryImpl.newInstance(ObjectFactoryImpl.java:30)
at org.testng.internal.ClassHelper.createInstance1(ClassHelper.java:423)
at org.testng.internal.ClassHelper.createInstance(ClassHelper.java:336)
at org.testng.internal.ClassImpl.getDefaultInstance(ClassImpl.java:125)
at org.testng.internal.ClassImpl.getInstances(ClassImpl.java:190)
at org.testng.TestClass.getInstances(TestClass.java:95)
at org.testng.TestClass.initTestClassesAndInstances(TestClass.java:81)
at org.testng.TestClass.init(TestClass.java:73)
at org.testng.TestClass.<init>(TestClass.java:38)
at org.testng.TestRunner.initMethods(TestRunner.java:389)
at org.testng.TestRunner.init(TestRunner.java:271)
at org.testng.TestRunner.init(TestRunner.java:241)
at org.testng.TestRunner.<init>(TestRunner.java:192)
at org.testng.remote.support.RemoteTestNG6_12$1.newTestRunner(RemoteTestNG6_12.java:33)
at org.testng.remote.support.RemoteTestNG6_12$DelegatingTestRunnerFactory.newTestRunner(RemoteTestNG6_12.java:66)
at org.testng.SuiteRunner$ProxyTestRunnerFactory.newTestRunner(SuiteRunner.java:713)
at org.testng.SuiteRunner.init(SuiteRunner.java:260)
at org.testng.SuiteRunner.<init>(SuiteRunner.java:198)
at org.testng.TestNG.createSuiteRunner(TestNG.java:1295)
at org.testng.TestNG.createSuiteRunners(TestNG.java:1273)
at org.testng.TestNG.runSuitesLocally(TestNG.java:1128)
at org.testng.TestNG.runSuites(TestNG.java:1049)
at org.testng.TestNG.run(TestNG.java:1017)
at org.testng.remote.AbstractRemoteTestNG.run(AbstractRemoteTestNG.java:114)
at org.testng.remote.RemoteTestNG.initAndRun(RemoteTestNG.java:251)
at org.testng.remote.RemoteTestNG.main(RemoteTestNG.java:77)
Caused by: java.lang.reflect.InvocationTargetException
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(Unknown Source)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(Unknown Source)
at java.lang.reflect.Constructor.newInstance(Unknown Source)
at org.testng.internal.ObjectFactoryImpl.newInstance(ObjectFactoryImpl.java:24)
... 25 more
Caused by: java.lang.Error: Unresolved compilation problem:

at extent.ExtentManager.getInstance(ExtentManager.java:14)
at testcases.RegTest.<init>(RegTest.java:15)
... 30 more

 

 


A
Ashish Thakur Replied on 01/11/2019

As i can see in the screenshot, there is an issue in ExtentManager.java. Please rectify that and then try executing the code.


K
Kapil Kuriakose Replied on 01/11/2019

Now there is below error shown:-

[RemoteTestNG] detected TestNG version 6.14.2
A                                                                             //--> this is a test line this is being executed. next line onwards nothing is working.
FAILED: registration
java.lang.Error: Unresolved compilation problem:

 

=====================RegTest.java=================

package testcases;

import org.testng.annotations.Test;
import org.testng.asserts.SoftAssert;

import com.relevantcodes.extentreports.*;

import extent.ExtentManager;

public class RegTest {

ExtentReports rep;
ExtentTest test;

@Test
public void registration() {
System.out.println("A");

rep = ExtentManager.getInstance();
test = rep.startTest("ApplicationTest");
test.log(LogStatus.INFO, "reg test line");

int actual =20;
int expected = 20;

SoftAssert sa = new SoftAssert();
System.out.println("Start");

sa.assertEquals(actual, expected);
sa.assertEquals("a", "a");
System.out.println("***********End************");

sa.assertAll();

rep.endTest(test);
rep.flush();

}
}


A
Ashish Thakur Replied on 05/11/2019

Please open the Problems view then share the screenshot.

Window --> Show View --> Problems


A
Ashish Thakur Replied on 06/11/2019

Any update?