cucumber / common

A home for issues that are common to multiple cucumber repositories
https://cucumber.io/docs
MIT License
3.36k stars 694 forks source link

I am getting below issue, while running cucumber tests. Can anybody help me? #690

Closed roop152 closed 5 years ago

roop152 commented 5 years ago

I am using java 8 cucumber-java 4.3.2 cucumber-core 1.2.5 cucumber html -0.2.7 Maven dependencies

Getting below issue. While running cucumber feature files using run configuration.

cucumber.runtime.CucumberException: No backends were found. Please make sure you have a backend module on your CLASSPATH. at cucumber.runtime.Runtime.(Runtime.java:81) at cucumber.runtime.Runtime.(Runtime.java:70) at cucumber.runtime.Runtime.(Runtime.java:66) at Lib.Controller.Driver.run(Driver.java:305) at Lib.Controller.Driver.main(Driver.java:213) at Lib.Controller.ThreadRunner$1.run(ThreadRunner.java:339) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) at java.lang.Thread.run(Thread.java:748) cucumber.runtime.CucumberException: No backends were found. Please make sure you have a backend module on your CLASSPATH. at cucumber.runtime.Runtime.(Runtime.java:81) at cucumber.runtime.Runtime.(Runtime.java:70) at cucumber.runtime.Runtime.(Runtime.java:66) at Lib.Controller.Driver.run(Driver.java:305) at Lib.Controller.Driver.main(Driver.java:213) at Lib.Controller.ThreadRunner$1.run(ThreadRunner.java:339) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) at java.lang.Thread.run(Thread.java:748) cucumber.runtime.CucumberException: No backends were found. Please make sure you have a backend module on your CLASSPATH. at cucumber.runtime.Runtime.(Runtime.java:81) at cucumber.runtime.Runtime.(Runtime.java:70) at cucumber.runtime.Runtime.(Runtime.java:66) at Lib.Controller.Driver.run(Driver.java:305) No backends were found. Please make sure you have a backend module on your CLASSPATH. null No backends were found. Please make sure you have a backend module on your CLASSPATH. null No backends were found. Please make sure you have a backend module on your CLASSPATH. No backends were found. Please make sure you have a backend module on your CLASSPATH. No backends were found. Please make sure you have a backend module on your CLASSPATH. at Lib.Controller.Driver.main(Driver.java:213) at Lib.Controller.ThreadRunner$1.run(ThreadRunner.java:339) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) at java.lang.Thread.run(Thread.java:748) cucumber.runtime.CucumberException: No backends were found. Please make sure you have a backend module on your CLASSPATH. at cucumber.runtime.Runtime.(Runtime.java:81) at cucumber.runtime.Runtime.(Runtime.java:70) at cucumber.runtime.Runtime.(Runtime.java:66) at Lib.Controller.Driver.run(Driver.java:305) at Lib.Controller.Driver.main(Driver.java:213) at Lib.Controller.ThreadRunner$1.run(ThreadRunner.java:339) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) at java.lang.Thread.run(Thread.java:748) cucumber.runtime.CucumberException: No backends were found. Please make sure you have a backend module on your CLASSPATH. at cucumber.runtime.Runtime.(Runtime.java:81) at cucumber.runtime.Runtime.(Runtime.java:70) at cucumber.runtime.Runtime.(Runtime.java:66) at Lib.Controller.Driver.run(Driver.java:305) at Lib.Controller.Driver.main(Driver.java:213) at Lib.Controller.ThreadRunner$1.run(ThreadRunner.java:339) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) at java.lang.Thread.run(Thread.java:748) cucumber.runtime.CucumberException: No backends were found. Please make sure you have a backend module on your CLASSPATH. at cucumber.runtime.Runtime.(Runtime.java:81) at cucumber.runtime.Runtime.(Runtime.java:70) at cucumber.runtime.Runtime.(Runtime.java:66) at Lib.Controller.Driver.run(Driver.java:305) at Lib.Controller.Driver.main(Driver.java:213) at Lib.Controller.ThreadRunner$1.run(ThreadRunner.java:339) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) at java.lang.Thread.run(Thread.java:748) cucumber.runtime.CucumberException: No backends were found. Please make sure you have a backend module on your CLASSPATH. at cucumber.runtime.Runtime.(Runtime.java:81) at cucumber.runtime.Runtime.(Runtime.java:70) at cucumber.runtime.Runtime.(Runtime.java:66) at Lib.Controller.Driver.run(Driver.java:305) at Lib.Controller.Driver.main(Driver.java:213) at Lib.Controller.ThreadRunner$1.run(ThreadRunner.java:339) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) at java.lang.Thread.run(Thread.java:748) cucumber.runtime.CucumberException: No backends were found. Please make sure you have a backend module on your CLASSPATH. at cucumber.runtime.Runtime.(Runtime.java:81) at cucumber.runtime.Runtime.(Runtime.java:70) at cucumber.runtime.Runtime.(Runtime.java:66) at Lib.Controller.Driver.run(Driver.java:305) at Lib.Controller.Driver.main(Driver.java:213) at Lib.Controller.ThreadRunner$1.run(ThreadRunner.java:339) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) at java.lang.Thread.run(Thread.java:748) cucumber.runtime.CucumberException: No backends were found. Please make sure you have a backend module on your CLASSPATH. at cucumber.runtime.Runtime.(Runtime.java:81) at cucumber.runtime.Runtime.(Runtime.java:70) at cucumber.runtime.Runtime.(Runtime.java:66) at Lib.Controller.Driver.run(Driver.java:305) at Lib.Controller.Driver.main(Driver.java:213) at Lib.Controller.ThreadRunner$1.run(ThreadRunner.java:339) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) at java.lang.Thread.run(Thread.java:748) cucumber.runtime.CucumberException: No backends were found. Please make sure you have a backend module on your CLASSPATH. at cucumber.runtime.Runtime.(Runtime.java:81) at cucumber.runtime.Runtime.(Runtime.java:70)

luke-hill commented 5 years ago

Could you follow the issue template, specifically the part about providing an MVCE (Ideally in the form of a github repo), then a Java maintainer could triage your issue.

Also could you check whether you have a backend module on your classpath, as the error indicates

roop152 commented 5 years ago

I am using below code to run the cucumber tests

in args passing like this String[] argv:- [--glue, defFiles, -f, json:target/82720191627PDT1566893187389/cucumber-report1.json, C:\New Selenium\Salesforce_QA_Automation\ADT_Resources\SalesForce\FeatureFiles\CROSS_OVER_DATE\Amend_Dec_License_NonInventory_TopProducerCRM_DL.feature] ClassLoader :- Passing current thread in the method.

getting issue in runtime class in the below method runtime = new Runtime(resourceLoader, classFinder, classLoader, runtimeOptions);

public static byte run(String[] argv, ClassLoader classLoader) throws IOException {
    try{
    RuntimeOptions runtimeOptions = null;
    Runtime runtime = null;
    //          runtimeOptions = new RuntimeOptions(System.getProperties(), argv);
    //          runtime = new Runtime(new MultiLoader(classLoader), classLoader, runtimeOptions);
    runtimeOptions = new RuntimeOptions(new ArrayList<String>(asList(argv)));
    ResourceLoader resourceLoader = new MultiLoader(classLoader);
    ClassFinder classFinder = new ResourceLoaderClassFinder(resourceLoader, classLoader);
    runtime = new Runtime(resourceLoader, classFinder, classLoader, runtimeOptions);
    List<String> featureFiles = runtimeOptions.getFeaturePaths();
    List<Object> Filters = runtimeOptions.getFilters();
    List<String> CukeGlues = runtimeOptions.getGlue();
    Driver.Gprops.SetCukeFilters(Thread.currentThread().getName(),Filters);
    Driver.Gprops.SetCukeGlues(Thread.currentThread().getName(),CukeGlues);
    Driver.Gprops.SetFeatureFiles(Thread.currentThread().getName(),featureFiles);
    CheckFeatureFiles(featureFiles,Filters);
    //WriteToConfigFile(ProcessFeaturandFilters(featureFiles,Filters));
    //          runtime.writeStepdefsJson();
    System.out.println();
    if(ExecuteCucke){
        runtime.run();
        T = runtime.getErrors();
        List<String> MissingSnippets = runtime.getSnippets();
        if(MissingSnippets.size() > 0){
            Driver.CUtil.WriteResults("Printing the missing Step defenition/s", "run", "");
            for(int x=0; x<MissingSnippets.size(); x++){
                Driver.CUtil.WriteResults(MissingSnippets.get(x), "run", "");
            }
        }
        if(T.size() > 0){
            Driver.CUtil.WriteResults("Printing Cucumber RunTime Error/s", "run", "");
            for(int y=0;y<T.size(); y++){
                StackTraceElement[] st = T.get(y).getStackTrace();
                String stString = "";
                for(int z=0; z< st.length; z++){
                    stString += " File Name: " +  st[z].getFileName() + " Method name: " + st[z].getMethodName() + "(" + st[z].getLineNumber() + ")<br>";
                }
                stString += "<br>Complete Error Message: " + T.get(y).getMessage() + "<br>";
                Driver.CUtil.WriteResults(stString, "run", "fail");
            }
        }
        //              Driver.CUtil.ComposeProcessedLog();
        // following code added by KK to insert the values to cukeresults table - 05/12/2013
        //              String plHtml = "http://QAZ02HTP900:8080/Result/"+Driver.Gprops.GetRunID()+"/ProcessedLog.html";
        //              String foHtml = "http://QAZ02HTP900:8080/Result/"+Driver.Gprops.GetRunID()+"/feature-overview.html";
        //              String lgHtml = "http://QAZ02HTP900:8080/Result/"+Driver.Gprops.GetRunID()+"/Log.html";
        //              Driver.DBCon.InsertCuckResult(Driver.Gprops.GetRunID(), System.getProperty("ProjectName"), System.getProperty("EnvFileName"), plHtml, foHtml, lgHtml, String.valueOf(Driver.Gprops.GetPassCounter()), String.valueOf(Driver.Gprops.GetFailCounter()));
        //              Driver.CUtil.CreateIndexFile();

    }
    //        System.exit(runtime.exitStatus());

  }
  catch(Exception ex){
       System.out.println(ex.getMessage());
    ex.printStackTrace();
  }
  return runtime.exitStatus();
}
roop152 commented 5 years ago

Above mentioned code, For Ant it is working fine. But, I have converted ant to maven project. After that it is not working and getting above mentioned issue.

luke-hill commented 5 years ago

As mentioned we need an MVCE, I / other maintainers won't try to cobble together code from copying and pasting.

https://stackoverflow.com/help/minimal-reproducible-example http://sscce.org/ http://catb.org/~esr/faqs/smart-questions.html

Few links to give you some pointers.

mpkorstanje commented 5 years ago

Maven dependencies:

  • cucumber-java 4.3.2
  • cucumber-core 1.2.5
  • cucumber html -0.2.7

These versions will not work together. You should use the same version of all cucumber-* dependencies and you should not include transitive dependencies in your dependency section.

I also suspect that due to your custom runner you will have to use 1.2.5.

Given the amount of customization you have done there is nothing we can do without an MCVE. Please feel free to reopen this issue when you can provide one.

roop152 commented 5 years ago

I have resolved this issue by moving all the code in to maven project structure.

ManjuManju25 commented 8 months ago

i am getting this error , please give me the solution

2024-03-12 17:09:29 INFO Log4j:45 - Inside TestNG > @BeforeSuite 17:09:29.212 [main] INFO org.testng.internal.Utils - [Utils] DynamicGraphHelper.createDynamicGraph() took 3 ms. 2024-03-12 17:09:29 INFO Log4j:64 - Inside TestNG > @DataProvider 17:09:29.224 [main] ERROR org.testng.internal.Utils - [Error] java.lang.NullPointerException: Cannot invoke "cucumber.api.testng.TestNGCucumberRunner.provideFeatures()" because "this.testNGCucumberRunner" is null at CDMNext.runner.TestRunner.features(TestRunner.java:65) at java.base/jdk.internal.reflect.DirectMethodHandleAccessor.invoke(DirectMethodHandleAccessor.java:103) at java.base/java.lang.reflect.Method.invoke(Method.java:580) at org.testng.internal.invokers.MethodInvocationHelper.invokeMethod(MethodInvocationHelper.java:139) at org.testng.internal.invokers.MethodInvocationHelper.invokeMethod(MethodInvocationHelper.java:84) at org.testng.internal.invokers.MethodInvocationHelper.invokeMethodNoCheckedException(MethodInvocationHelper.java:53) at org.testng.internal.invokers.MethodInvocationHelper.invokeDataProvider(MethodInvocationHelper.java:157) at org.testng.internal.Parameters.handleParameters(Parameters.java:803) at org.testng.internal.Parameters.handleParameters(Parameters.java:728) at org.testng.internal.invokers.ParameterHandler.handleParameters(ParameterHandler.java:72) at org.testng.internal.invokers.ParameterHandler.createParameters(ParameterHandler.java:51) at org.testng.internal.invokers.TestInvoker$MethodInvocationAgent.invoke(TestInvoker.java:911) at org.testng.internal.invokers.TestInvoker.invokeTestMethods(TestInvoker.java:200) at org.testng.internal.invokers.TestMethodWorker.invokeTestMethods(TestMethodWorker.java:148) at org.testng.internal.invokers.TestMethodWorker.run(TestMethodWorker.java:128) at java.base/java.util.ArrayList.forEach(ArrayList.java:1596) at org.testng.TestRunner.privateRun(TestRunner.java:848) at org.testng.TestRunner.run(TestRunner.java:621) at org.testng.SuiteRunner.runTest(SuiteRunner.java:443) at org.testng.SuiteRunner.runSequentially(SuiteRunner.java:437) at org.testng.SuiteRunner.privateRun(SuiteRunner.java:397) at org.testng.SuiteRunner.run(SuiteRunner.java:336) at org.testng.SuiteRunnerWorker.runSuite(SuiteRunnerWorker.java:52) at org.testng.SuiteRunnerWorker.run(SuiteRunnerWorker.java:95) at org.testng.TestNG.runSuitesSequentially(TestNG.java:1280) at org.testng.TestNG.runSuitesLocally(TestNG.java:1200) at org.testng.TestNG.runSuites(TestNG.java:1114) at org.testng.TestNG.run(TestNG.java:1082) at org.testng.remote.AbstractRemoteTestNG.run(AbstractRemoteTestNG.java:115) at org.testng.remote.RemoteTestNG.initAndRun(RemoteTestNG.java:251) at org.testng.remote.RemoteTestNG.main(RemoteTestNG.java:77)

FAILED CONFIGURATION: @BeforeSuite CDMNext.runner.TestRunner.setUpClass cucumber.runtime.CucumberException: No backends were found. Please make sure you have a backend module on your CLASSPATH. at cucumber.runtime.Runtime.(Runtime.java:81) at cucumber.runtime.Runtime.(Runtime.java:70) at cucumber.runtime.Runtime.(Runtime.java:66) at cucumber.api.testng.TestNGCucumberRunner.(TestNGCucumberRunner.java:42) at CDMNext.runner.TestRunner.setUpClass(TestRunner.java:46) at java.base/jdk.internal.reflect.DirectMethodHandleAccessor.invoke(DirectMethodHandleAccessor.java:103) at java.base/java.lang.reflect.Method.invoke(Method.java:580) at org.testng.internal.invokers.MethodInvocationHelper.invokeMethod(MethodInvocationHelper.java:139) at org.testng.internal.invokers.MethodInvocationHelper.invokeMethodConsideringTimeout(MethodInvocationHelper.java:69) at org.testng.internal.invokers.ConfigInvoker.invokeConfigurationMethod(ConfigInvoker.java:390) at org.testng.internal.invokers.ConfigInvoker.invokeConfigurations(ConfigInvoker.java:325) at org.testng.SuiteRunner.privateRun(SuiteRunner.java:382) at org.testng.SuiteRunner.run(SuiteRunner.java:336) at org.testng.SuiteRunnerWorker.runSuite(SuiteRunnerWorker.java:52) at org.testng.SuiteRunnerWorker.run(SuiteRunnerWorker.java:95) at org.testng.TestNG.runSuitesSequentially(TestNG.java:1280) at org.testng.TestNG.runSuitesLocally(TestNG.java:1200) at org.testng.TestNG.runSuites(TestNG.java:1114) at org.testng.TestNG.run(TestNG.java:1082) at org.testng.remote.AbstractRemoteTestNG.run(AbstractRemoteTestNG.java:115) at org.testng.remote.RemoteTestNG.initAndRun(RemoteTestNG.java:251) at org.testng.remote.RemoteTestNG.main(RemoteTestNG.java:77)

FAILED: CDMNext.runner.TestRunner.feature Runs Cucumber Feature java.lang.RuntimeException: java.lang.NullPointerException: Cannot invoke "cucumber.api.testng.TestNGCucumberRunner.provideFeatures()" because "this.testNGCucumberRunner" is null at org.testng.internal.invokers.MethodInvocationHelper.invokeMethodNoCheckedException(MethodInvocationHelper.java:57) at org.testng.internal.invokers.MethodInvocationHelper.invokeDataProvider(MethodInvocationHelper.java:157) at org.testng.internal.Parameters.handleParameters(Parameters.java:803) at org.testng.internal.Parameters.handleParameters(Parameters.java:728) at org.testng.internal.invokers.ParameterHandler.handleParameters(ParameterHandler.java:72) at org.testng.internal.invokers.ParameterHandler.createParameters(ParameterHandler.java:51) at org.testng.internal.invokers.TestInvoker$MethodInvocationAgent.invoke(TestInvoker.java:911) at org.testng.internal.invokers.TestInvoker.invokeTestMethods(TestInvoker.java:200) at org.testng.internal.invokers.TestMethodWorker.invokeTestMethods(TestMethodWorker.java:148) at org.testng.internal.invokers.TestMethodWorker.run(TestMethodWorker.java:128) at java.base/java.util.ArrayList.forEach(ArrayList.java:1596) at org.testng.TestRunner.privateRun(TestRunner.java:848) at org.testng.TestRunner.run(TestRunner.java:621) at org.testng.SuiteRunner.runTest(SuiteRunner.java:443) at org.testng.SuiteRunner.runSequentially(SuiteRunner.java:437) at org.testng.SuiteRunner.privateRun(SuiteRunner.java:397) at org.testng.SuiteRunner.run(SuiteRunner.java:336) at org.testng.SuiteRunnerWorker.runSuite(SuiteRunnerWorker.java:52) at org.testng.SuiteRunnerWorker.run(SuiteRunnerWorker.java:95) at org.testng.TestNG.runSuitesSequentially(TestNG.java:1280) at org.testng.TestNG.runSuitesLocally(TestNG.java:1200) at org.testng.TestNG.runSuites(TestNG.java:1114) at org.testng.TestNG.run(TestNG.java:1082) at org.testng.remote.AbstractRemoteTestNG.run(AbstractRemoteTestNG.java:115) at org.testng.remote.RemoteTestNG.initAndRun(RemoteTestNG.java:251) at org.testng.remote.RemoteTestNG.main(RemoteTestNG.java:77) Caused by: java.lang.NullPointerException: Cannot invoke "cucumber.api.testng.TestNGCucumberRunner.provideFeatures()" because "this.testNGCucumberRunner" is null at CDMNext.runner.TestRunner.features(TestRunner.java:65) at java.base/jdk.internal.reflect.DirectMethodHandleAccessor.invoke(DirectMethodHandleAccessor.java:103) at java.base/java.lang.reflect.Method.invoke(Method.java:580) at org.testng.internal.invokers.MethodInvocationHelper.invokeMethod(MethodInvocationHelper.java:139) at org.testng.internal.invokers.MethodInvocationHelper.invokeMethod(MethodInvocationHelper.java:84) at org.testng.internal.invokers.MethodInvocationHelper.invokeMethodNoCheckedException(MethodInvocationHelper.java:53) ... 25 more

this are the pom.xml

<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">

4.0.0
<groupId>com.ceicdata</groupId>
<artifactId>CDMNext</artifactId>
<version>0.0.1-SNAPSHOT</version>

<name>MARKETSN</name>
<url>http://maven.apache.org</url>

<properties>
    <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
 </properties>

 <build>
     <pluginManagement>
         <plugins>

             <plugin>
                 <groupId>org.apache.maven.plugins</groupId>
                 <artifactId>maven-compiler-plugin</artifactId>
                 <version>3.12.1</version>
                 <configuration>
                     <source>21</source>
                     <target>21</target>
                     <fork>true</fork>
                     <!--<executable>C:\Program Files\Java\jdk1.8.0_121\bin\javac.exe</executable> -->
                     <executable>${env.JAVA_HOME}\bin\javac.exe</executable>
                 </configuration>
             </plugin>
             <plugin>   

                 <groupId>org.apache.maven.plugins</groupId>
                 <artifactId>maven-surefire-plugin</artifactId>
                 <version>3.2.5</version>
                 <configuration>
                     <!-- <testFailureIgnore>true</testFailureIgnore> -->
                     <suiteXmlFiles>
                         <suiteXmlFile>testng.xml</suiteXmlFile>
                     </suiteXmlFiles>
                 </configuration>
             </plugin>
             <plugin>
                 <groupId>net.masterthought</groupId>
                 <artifactId>maven-cucumber-reporting</artifactId>
                 <version>5.7.8</version>
                 <executions>
                    <execution>
                        <id>execution</id>
                        <phase>verify</phase>
                        <goals>
                            <goal>generate</goal>
                        </goals>
                        <configuration>
                            <projectName>Cucumber-jvm-report</projectName>
                            <outputDirectory>${project.build.directory}/target/cucumber-report-html</outputDirectory>
                            <cucumberOutput>${project.build.directory}/target/cucumber-reports/CucumberTestReport.json</cucumberOutput>
                            <skippedFails>true</skippedFails>
                            <enableFlashCharts>true</enableFlashCharts>
                            <buildNumber>4.0.0_rc.7</buildNumber>
                        </configuration>
                    </execution>
                </executions>
            </plugin>
        </plugins>
    </pluginManagement>
</build>

<reporting>
    <plugins>
        <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-surefire-report-plugin</artifactId>
            <version>3.2.5</version>
        </plugin>
    </plugins>

</reporting>

<dependencies>

    <dependency>
        <groupId>org.seleniumhq.selenium</groupId>
        <artifactId>selenium-java</artifactId>
        <version>4.17.0</version>
    </dependency>

    <dependency>
        <groupId>io.github.bonigarcia</groupId>
        <artifactId>webdrivermanager</artifactId>
        <version>3.0.0</version>
    </dependency>

    <!-- https://mvnrepository.com/artifact/org.testng/testng -->
    <dependency>
        <groupId>org.testng</groupId>
        <artifactId>testng</artifactId>
        <version>7.8.0</version>
    </dependency>
        <!-- https://mvnrepository.com/artifact/io.cucumber/cucumber-java -->
    <dependency>
        <groupId>io.cucumber</groupId>
        <artifactId>cucumber-java</artifactId>
        <version>7.11.0</version>
    </dependency>

    <!-- https://mvnrepository.com/artifact/junit/junit -->
    <!-- <dependency> <groupId>junit</groupId> <artifactId>junit</artifactId> 
        <version>4.12</version> <scope>test</scope> </dependency> -->

    <!-- https://mvnrepository.com/artifact/info.cukes/cucumber-junit -->
<!--    <dependency>
        <groupId>info.cukes</groupId>
        <artifactId>cucumber-junit</artifactId>
        <version>1.2.6</version>
        <scope>test</scope>
    </dependency>  -->

    <!-- https://mvnrepository.com/artifact/io.cucumber/cucumber-junit -->
    <dependency>
         <groupId>io.cucumber</groupId>
         <artifactId>cucumber-junit</artifactId>
         <version>7.11.0</version>
         <scope>test</scope>
    </dependency>

       <dependency>
        <groupId>io.cucumber</groupId>
        <artifactId>cucumber-core</artifactId>
        <version>7.11.0</version>
     </dependency>

 <dependency>
        <groupId>io.cucumber</groupId>
        <artifactId>cucumber-picocontainer</artifactId>
        <version>7.11.0</version>
    </dependency>

    <dependency>
        <groupId>io.cucumber</groupId>
        <artifactId>cucumber-testng</artifactId>
        <version>7.11.0</version>
   </dependency>

    <!-- https://mvnrepository.com/artifact/info.cukes/cucumber-core -->
    <!-- https://mvnrepository.com/artifact/io.cucumber/cucumber-core -->

    <!-- https://mvnrepository.com/artifact/io.cucumber/cucumber-core -->
    <!-- https://mvnrepository.com/artifact/info.cukes/cucumber-html -->
<!--    <dependency>
        <groupId>info.cukes</groupId>
        <artifactId>cucumber-html</artifactId>
        <version>0.2.3</version>
    </dependency>  -->

    <!-- https://mvnrepository.com/artifact/io.cucumber/cucumber-html -->
   <dependency>
        <groupId>io.cucumber</groupId>
        <artifactId>cucumber-html</artifactId>
        <version>0.2.7</version>
   </dependency>

    <!-- https://mvnrepository.com/artifact/info.cukes/cucumber-java -->
<!--    <dependency>
        <groupId>info.cukes</groupId>
        <artifactId>cucumber-java</artifactId>
        <version>1.2.6</version>
    </dependency>   -->

    <!-- https://mvnrepository.com/artifact/info.cukes/cucumber-jvm-deps -->
    <!-- https://mvnrepository.com/artifact/io.cucumber/cucumber-jvm-deps -->
     <dependency>
          <groupId>io.cucumber</groupId>
          <artifactId>cucumber-jvm-deps</artifactId>
          <version>1.0.6</version>
          <scope>provided</scope>
     </dependency>

     <!-- https://mvnrepository.com/artifact/ru.yandex.qatools.ashot/ashot -->
     <dependency>
          <groupId>ru.yandex.qatools.ashot</groupId>
          <artifactId>ashot</artifactId>
          <version>1.5.4</version>
    </dependency>
    <!-- https://mvnrepository.com/artifact/com.google.code.gson/gson -->

     <dependency>
           <groupId>com.google.code.gson</groupId>
           <artifactId>gson</artifactId>
           <version>2.10.1</version>
     </dependency>
     <dependency>
          <groupId>org.hamcrest</groupId>
          <artifactId>hamcrest-all</artifactId>
          <version>1.3</version>
          <scope>test</scope>
     </dependency>

    <!-- https://mvnrepository.com/artifact/info.cukes/gherkin -->
    <!-- https://mvnrepository.com/artifact/io.cucumber/gherkin -->
    <dependency>
       <groupId>io.cucumber</groupId>
       <artifactId>gherkin</artifactId>
       <version>27.0.0</version>
     </dependency>

    <!-- https://mvnrepository.com/artifact/org.hamcrest/hamcrest-all -->
    <!-- https://mvnrepository.com/artifact/info.cukes/cucumber-picocontainer -->
    <!-- https://mvnrepository.com/artifact/io.cucumber/cucumber-picocontainer -->

    <!-- https://mvnrepository.com/artifact/info.cukes/cucumber-testng -->
    <!-- https://mvnrepository.com/artifact/io.cucumber/cucumber-testng -->
    <!-- https://mvnrepository.com/artifact/org.freemarker/freemarker -->
    <dependency>
        <groupId>org.freemarker</groupId>
        <artifactId>freemarker</artifactId>
        <version>2.3.29</version>
    </dependency>

    <!-- https://mvnrepository.com/artifact/net.masterthought/cucumber-reporting -->

    <dependency>
        <groupId>com.vimalselvam</groupId>
        <artifactId>cucumber-extentsreport</artifactId>
        <version>3.0.0</version>
    </dependency>

    <!-- https://mvnrepository.com/artifact/org.apache.logging.log4j/log4j-core -->
    <dependency>
        <groupId>org.apache.logging.log4j</groupId>
        <artifactId>log4j-core</artifactId>
        <version>2.18.0</version>
    </dependency>

    <!-- https://mvnrepository.com/artifact/javax.mail/javax.mail-api -->
    <dependency>
        <groupId>com.sun.mail</groupId>
        <artifactId>javax.mail</artifactId>
        <version>1.6.1</version>
        <scope>test</scope>
    </dependency>

    <dependency>
        <groupId>javax.mail</groupId>
        <artifactId>javax.mail-api</artifactId>
        <version>1.5.5</version>
    </dependency>
    <!-- https://mvnrepository.com/artifact/org.apache.maven.scm/maven-scm-api -->
    <dependency>
        <groupId>org.apache.maven.scm</groupId>
        <artifactId>maven-scm-api</artifactId>
        <version>1.11.1</version>
    </dependency>
    <dependency>
        <groupId>org.apache.poi</groupId>
        <artifactId>poi</artifactId>
        <version>3.9</version>
    </dependency>
    <dependency>
        <groupId>org.apache.poi</groupId>
        <artifactId>poi-ooxml</artifactId>
        <version>3.9</version>
    </dependency>

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

    <!-- https://mvnrepository.com/artifact/com.github.mkolisnyk/cucumber-runner -->
    <dependency>
        <groupId>com.github.mkolisnyk</groupId>
        <artifactId>cucumber-runner</artifactId>
        <version>1.3.5</version>
    </dependency>
    <!-- https://mvnrepository.com/artifact/org.seleniumhq.selenium/selenium-server -->
    <!-- <dependency> <groupId>org.seleniumhq.selenium</groupId> <artifactId>selenium-server</artifactId> 
        <version>2.53.1</version> </dependency> -->

    <!-- https://mvnrepository.com/artifact/com.aventstack/extentreports -->
    <!-- <dependency> <groupId>com.aventstack</groupId> <artifactId>extentreports</artifactId> 
        <version>4.0.6</version> </dependency> -->

    <!-- https://mvnrepository.com/artifact/net.sourceforge.tess4j/tess4j -->
    <dependency>
        <groupId>net.sourceforge.tess4j</groupId>
        <artifactId>tess4j</artifactId>
        <version>4.2.1</version>
    </dependency>
    <!-- <dependency> -->
    <!-- <groupId>org.slf4j</groupId> -->
    <!-- <artifactId>slf4j-api</artifactId> -->
    <!-- <version>1.7.7</version> -->
    <!-- </dependency> -->
    <dependency>
        <groupId>org.slf4j</groupId>
        <artifactId>slf4j-log4j12</artifactId>
        <version>2.0.12</version>
    </dependency>
    <dependency>
        <groupId>com.jcabi</groupId>
        <artifactId>jcabi-log</artifactId>
        <version>0.17.4</version>
    </dependency>   

    <!-- https://mvnrepository.com/artifact/commons-io/commons-io -->
    <dependency>
        <groupId>commons-io</groupId>
        <artifactId>commons-io</artifactId>
        <version>2.15.1</version>
    </dependency>
    <!-- https://mvnrepository.com/artifact/com.thoughtworks.xstream/xstream -->
    <dependency>
         <groupId>com.thoughtworks.xstream</groupId>
         <artifactId>xstream</artifactId>
         <version>1.4.20</version>
     </dependency>

   <!-- https://mvnrepository.com/artifact/net.sourceforge.htmlunit/htmlunit -->
    <dependency>
         <groupId>net.sourceforge.htmlunit</groupId>
         <artifactId>htmlunit</artifactId>
         <version>2.70.0</version>
    </dependency>

 </dependencies>

i am using java 21 version

mpkorstanje commented 8 months ago

You're using info.cukes instead of io.cucumber. info.cukes is a very old version of Cucumber that doesn't work with Java 9+. For an example of an up to date project please see: https://github.com/cucumber/cucumber-java-skeleton/

For guides on upgrading see: https://github.com/cucumber/cucumber-jvm/tree/main/release-notes