Cucumber Exception: java.lang.ClassNotFoundException: cucumber.io.ResourceLoader

后端 未结 3 1110
有刺的猬
有刺的猬 2020-12-19 15:17

I am facing an error whenever I run the cucumber test by Junit. Here is the following Exception. Any help will be awesome

NOTE:

THER

相关标签:
3条回答
  • 2020-12-19 15:30

    You are trying to run Cucumber in java, and you haven't loaded the Cucumber-java dependency? How's your Cucumber supposed to execute?

    Here are the minimum dependencies needed to get your Cucumber up & running:

    -Cucumber-java (1.2.2) -Cucumber-junit (1.2.2) -Cucumber-picocontainer (1.2.2) -junit (4.12)

    Maven manages the rest of the dependencies. Make sure you have the latest dependencies, and that you are not mixing and matching versions (for example, I've used all 1.2.2 version)

    Edit: Just noticed that your Cucumber-java is at the bottom of the pom.xml. It's a good practice to order your dependencies....all cucumber dependencies go together, one after another.

    0 讨论(0)
  • 2020-12-19 15:36

    It looks like you're missing the cucumber-core library.

    Try adding the following to your dependencies.

        <dependency>
            <groupId>info.cukes</groupId>
            <artifactId>cucumber-core</artifactId>
            <version>1.1.8</version>
        </dependency>
    

    Also, you appear to be mixing and matching versions. Try using the same version for all the cucumber-* libraries.

    0 讨论(0)
  • 2020-12-19 15:55

    Make sure all your cucumber-* jars have the same version, Try this thing - It should resolve your issue.

    0 讨论(0)
提交回复
热议问题