Junit Runner Class Unable to locate Step Definition file

Asif

JUnit Runner class is unable to locate the Steps definition file with project structure Below: src/test/java/com/testSteps/TestSteps.java and JunitRunner class under src/test/java/com/cucumbertestrunner/TestRunner

[(Project Hierarchy is attached Below) Following is the syntax of JUnitRunner class

package com.cucumbertestrunner;

import cucumber.api.CucumberOptions;
import cucumber.api.junit.Cucumber;
import org.junit.runner.RunWith;  
@RunWith(Cucumber.class)
@CucumberOptions(features ={"src/test/resources/TestSteps.feature"},
glue ={"src/test/java/com"},strict = true,plugin = {"pretty", "html:target/cucumber"})
public class TestRunner {

}

Running the TestRunner.java as JUnit Test shows following exception:

at cucumber.api.PendingException: TODO: implement me at cucumber.runtime.junit.JUnitReporter.addFailure(JUnitReporter.java:134) cucumber.runtime.junit.JUnitReporter.addFailureOrIgnoreStep(JUnitReporter.java:122) at cucumber.runtime.junit.JUnitReporter.result(JUnitReporter.java:91) at cucumber.runtime.Runtime.runStep(Runtime.java:281) at cucumber.runtime.model.StepContainer.runStep(StepContainer.java:44) at cucumber.runtime.model.StepContainer.runSteps(StepContainer.java:39) at cucumber.runtime.model.CucumberScenario.run(CucumberScenario.java:44) at cucumber.runtime.junit.ExecutionUnitRunner.run(ExecutionUnitRunner.java:91) at cucumber.runtime.junit.FeatureRunner.runChild(FeatureRunner.java:63) at cucumber.runtime.junit.FeatureRunner.runChild(FeatureRunner.java:18) at org.junit.runners.ParentRunner$3.run(ParentRunner.java:238) at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:63) at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:236) at org.junit.runners.ParentRunner.access$000(ParentRunner.java:53) at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:229) at org.junit.runners.ParentRunner.run(ParentRunner.java:309) at cucumber.runtime.junit.FeatureRunner.run(FeatureRunner.java:70)

Please Help.

Gerald Mücke

Please look into the TestSteps class, and what the step methods contain. Throwing the PendingException is the default implementation for the steps. You have to actually implement what the step should do.

Apart from that, I suggest to setthe location of the steps as a package, because steps are defined in classes and those have to be located in the classpath.

For example

 glue = {"com.teststeps"}

I also suggest to refer to the feature files in the classpath, as they are located in the resources folder

features = {"classpath:TestSteps.feature}

Collected from the Internet

Please contact [email protected] to delete if infringement.

edited at
0

Comments

0 comments
Login to comment

Related

From Dev

Cucumber - Unable to execute the step definition file

From Dev

Unable to locate element with cucumber step_definition, but able to locate it with capybara stand-alone

From Dev

QuerySyntaxException: Unable to locate class

From Dev

HibernateQueryException: Unable to locate class

From Dev

Cucumber: Unable to find step definition

From Java

stunnel Unable to Locate Log File

From Java

No tasks available when executing JUnit runner class

From Dev

Static methods called with base class property in specflow step from definition file refer to property as null

From Dev

Extract Jest step definition to a separate file

From Dev

hibernate: Unable to locate appropriate constructor on class - HQL

From Dev

Criteria API Unable to locate appropriate constructor on class

From Dev

JPA - Unable to locate appropriate constructor on class

From Dev

JMagick Configure File Unable to Locate Java Directories

From Dev

TFS build unable to locate the project file and dlls

From Dev

Jenkins - Unable to locate requirements.txt file

From Dev

Unable to mock BufferedWriter class in junit

From Dev

Could not find or load main class org.junit.runner.JUnitCore

From Dev

Make jUnit runner run test class multiple times with different parameters

From Dev

How to navigate to the Step definition from the feature file using Appium and cucumber?

From Dev

Unable to locate class after new object in select query

From Dev

Unable to locate the specified class: Hooks.php in codeigniter

From Dev

Unable to locate a number found in a text file c#

From Dev

file_get_contents(): Unable to locate certificate CN

From Dev

Bash File Unable to locate package when new line is added

From Dev

Heroku unable to access jetty-runner jar file

From Dev

How do I extend a TypeScript class definition in a separate definition file?

From Dev

Declaring a super class in a TypeScript definition file

From Java

Import class in definition file (*d.ts)

From Java

Enum inside class (TypeScript definition file)

Related Related

  1. 1

    Cucumber - Unable to execute the step definition file

  2. 2

    Unable to locate element with cucumber step_definition, but able to locate it with capybara stand-alone

  3. 3

    QuerySyntaxException: Unable to locate class

  4. 4

    HibernateQueryException: Unable to locate class

  5. 5

    Cucumber: Unable to find step definition

  6. 6

    stunnel Unable to Locate Log File

  7. 7

    No tasks available when executing JUnit runner class

  8. 8

    Static methods called with base class property in specflow step from definition file refer to property as null

  9. 9

    Extract Jest step definition to a separate file

  10. 10

    hibernate: Unable to locate appropriate constructor on class - HQL

  11. 11

    Criteria API Unable to locate appropriate constructor on class

  12. 12

    JPA - Unable to locate appropriate constructor on class

  13. 13

    JMagick Configure File Unable to Locate Java Directories

  14. 14

    TFS build unable to locate the project file and dlls

  15. 15

    Jenkins - Unable to locate requirements.txt file

  16. 16

    Unable to mock BufferedWriter class in junit

  17. 17

    Could not find or load main class org.junit.runner.JUnitCore

  18. 18

    Make jUnit runner run test class multiple times with different parameters

  19. 19

    How to navigate to the Step definition from the feature file using Appium and cucumber?

  20. 20

    Unable to locate class after new object in select query

  21. 21

    Unable to locate the specified class: Hooks.php in codeigniter

  22. 22

    Unable to locate a number found in a text file c#

  23. 23

    file_get_contents(): Unable to locate certificate CN

  24. 24

    Bash File Unable to locate package when new line is added

  25. 25

    Heroku unable to access jetty-runner jar file

  26. 26

    How do I extend a TypeScript class definition in a separate definition file?

  27. 27

    Declaring a super class in a TypeScript definition file

  28. 28

    Import class in definition file (*d.ts)

  29. 29

    Enum inside class (TypeScript definition file)

HotTag

Archive