You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Jan 15, 2023. It is now read-only.
I am building the project with stack: Gradle - Testng - Cucumber-JVM - Selenium - Java
I am trying to integrate extent reports with my project. My project runs fine if I don't add extent report plugin code in my runner file. I start getting null pointer exception with extent report plugin code.
I have removed the extended report code from teardown() method, and jenkins has removed 1 out of 2 error as Null Pointer from teardown. But it still showing "NullPointer" error at @BeforeClass > setup() method.
I stumbled over the same issue and found out that the problem is that you are using io.cucumber packages instead of the info.cukes which are the older package names for io.cucumber and still used by this project. I already created an issue about that.
When I find some spare time I might create a branch which uses the new io.cucumber packages instead if the older ones.
Sign up for freeto subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Hi Vimal,
I am building the project with stack: Gradle - Testng - Cucumber-JVM - Selenium - Java
I am trying to integrate extent reports with my project. My project runs fine if I don't add extent report plugin code in my runner file. I start getting null pointer exception with extent report plugin code.
Below is my build.gradle:
`apply plugin: 'java-library'
apply plugin: 'application'
apply plugin: 'java'
`
Below is my sample cucumber runner file:
`package com.bdc.neo.runner;
import cucumber.api.CucumberOptions;
import cucumber.api.testng.AbstractTestNGCucumberTests;
import java.io.File;
import org.testng.annotations.AfterClass;
import org.testng.annotations.BeforeClass;
import com.cucumber.listener.ExtentCucumberFormatter;
import com.cucumber.listener.ExtentProperties;
import com.cucumber.listener.Reporter;
@CucumberOptions(
features = {"Feature/Login.feature"},
glue= {"com.bdc.neo.stepdef"},
plugin= {"com.cucumber.listener.ExtentCucumberFormatter:output/Login.html",
"json:cucumber/json/LoginTR.json"}
)
public class LoginTR extends AbstractTestNGCucumberTests {
// @BeforeClass
// public static void setup()
// {
// ExtentProperties extentProperties = ExtentProperties.INSTANCE;
//// extentProperties.setExtentXServerUrl("http://localhost:1337");
//// extentProperties.setProjectName("MyProject");
// extentProperties.setReportPath("output/myreport.html");
// }
//
// public LoginTR() throws Exception{
// super();
// }
//
@afterclass
public static void teardown() {
Reporter.loadXMLConfig(new File("src/test/java/extent-config.xml"));
Reporter.setSystemInfo("user", System.getProperty("user.name"));
Reporter.setSystemInfo("os", "Mac OSX");
Reporter.setTestRunnerOutput("Sample test runner output message");
}
}
`
ANd below is the stack trace:
java.lang.NoClassDefError : gherkin/formatter/Reporter
With same settings it works fine without jenkins report plugin.
Please let me know if anything else is required from my end.
The text was updated successfully, but these errors were encountered: