2

1When i execute runner class i am getting this error " TestRunner [Junit] D:\Java\JDK-14.0.1\bin\javaw.exe"

package Runner;

import org.junit.runner.RunWith;

import io.cucumber.junit.Cucumber;
import io.cucumber.junit.CucumberOptions;

@RunWith(Cucumber.class)
@CucumberOptions(features="D:\\Eclipse\\eclipse-workspace\\FreeCrmBDDFramework\\src\\main\\java\\Features\\login.feature", glue= {"stepDefinition"})
public class TestRunner {

}

error screen shot

POM.xml - dependencies

<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">
  <modelVersion>4.0.0</modelVersion>

  <groupId>FreeCrmBDDFramework</groupId>
  <artifactId>FreeCrmBDDFramework</artifactId>
  <version>0.0.1-SNAPSHOT</version>

  <name>FreeCrmBDDFramework</name>
  <!-- FIXME change it to the project's website -->
  <url>http://www.example.com</url>

  <properties>
    <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
    <maven.compiler.source>1.7</maven.compiler.source>
    <maven.compiler.target>1.7</maven.compiler.target>
  </properties>

  <dependencies>
      <dependency>
      <groupId>io.cucumber</groupId>
      <artifactId>cucumber-java</artifactId>
      <version>6.0.0-RC2</version>
  </dependency>

    <dependency>
      <groupId>io.cucumber</groupId>
      <artifactId>cucumber-jvm</artifactId>
      <version>3.0.0</version>
      <type>pom</type>
  </dependency>
      <dependency>
      <groupId>io.cucumber</groupId>
      <artifactId>cucumber-junit</artifactId>
      <version>6.0.0-RC2</version>
  </dependency>
      <dependency>
      <groupId>io.cucumber</groupId>
      <artifactId>cucumber-jvm-deps</artifactId>
      <version>1.0.6</version>
      <scope>provided</scope>
  </dependency>
      <dependency>
      <groupId>net.masterthought</groupId>
      <artifactId>cucumber-reporting</artifactId>
      <version>5.3.0</version>
  </dependency>
      <dependency>
      <groupId>io.cucumber</groupId>
      <artifactId>gherkin</artifactId>
      <version>13.0.0</version>
  </dependency>
          <dependency>
      <groupId>org.seleniumhq.selenium</groupId>
      <artifactId>selenium-java</artifactId>
      <version>3.141.59</version>
  </dependency>

  </dependencies>

  <build>
    <pluginManagement><!-- lock down plugins versions to avoid using Maven defaults (may be moved to parent pom) -->
      <plugins>
        <!-- clean lifecycle, see https://maven.apache.org/ref/current/maven-core/lifecycles.html#clean_Lifecycle

--> maven-clean-plugin 3.1.0 maven-resources-plugin 3.0.2 maven-compiler-plugin 3.8.0 maven-surefire-plugin 2.22.1 maven-jar-plugin 3.0.2 maven-install-plugin 2.5.2 maven-deploy-plugin 2.8.2 maven-site-plugin 3.7.1 maven-project-info-reports-plugin 3.0.0

Dinesh
  • 21
  • 3
  • 1
    Could you please share an image of the log because it is unclear for us understand the issue – UnknownBeast May 21 '20 at 18:00
  • how to add screen shot and dependencies file? please advise. – Dinesh May 22 '20 at 04:20
  • Please update it in your question my friend :) – UnknownBeast May 22 '20 at 04:21
  • Click on edit button and there you will get an option to insert image. just check that out :) – UnknownBeast May 22 '20 at 04:22
  • I have added a link to an error which i am getting on console. How to add dependencies data to a question? Please guide me. – Dinesh May 22 '20 at 04:50
  • The project structure as well as cucumber configuration is incorrect. Please look into this sample project and let me know if you face any issue. https://drive.google.com/open?id=14ehatPyIueyJUNbS1tV2jKbAtSHs_ghX – UnknownBeast May 22 '20 at 05:38
  • One more thing after looking at the screenshot, I can say that execution is not even starting. The terminated message is not an error it is a status message that eclipse always shows once the execution gets completed :) – UnknownBeast May 22 '20 at 05:39
  • 1
    There are quite a few things wrong information you have provided so far. These may or may not be related to the error that you see, but they certainly don't help solving it. You may want to start from scratch with https://cucumber.io/docs/guides/10-minute-tutorial/ – M.P. Korstanje May 22 '20 at 10:28

1 Answers1

1

Right click on your project and Go to Build path > Configure build path > Java build path > add library. and add Junit 5 library. It will resolve the issue

Gangadhar
  • 11
  • 1