Exception in thread “main” java.lang.NoClassDefFoundError: gherkin/formatter/Formatter

后端 未结 1 1383
耶瑟儿~
耶瑟儿~ 2021-01-23 19:45

I am learning how to write BDD test scripts in JAVA using Cucumber. However, I keep getting the above error and not sure why. I have the Cukes Gherkin as a dependency.

相关标签:
1条回答
  • 2021-01-23 20:20

    I was working with cucumber with some selenium scripts today and came across a similar issue whenever I was using gherkin3 jar file.

    Once I switch back to using gherkin 2.12.2, the issue went away.

    You can download the jar from the following location:

    http://search.maven.org/#search%7Cga%7C1%7Cgherkin

    It is certainly worth trying this and checking if you get the same issue.

    I would also try running your feature file without any methods to check if you get it to return the methods you need to create, similar to the what is detailed in the document here:

    http://www.toolsqa.com/cucumber/first-cucumber-selenium-java-test/

    You don't need the glue option though like detailed in the example when you just what to run the feature file.

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