-1

我刚刚创建了功能文件和 POM,我尝试将功能文件作为 Cucumber 功能运行,但它显示如下错误,请告诉我我需要做什么?我安装了 Cucumber 插件,我使用了最新版本的 Cucumber 6.10.2,我做错了,我知道请帮我解决这个问题。然后我检查了特征路径也是正确的,我尝试使用运行配置运行,因为我为特征文件设置了正确的路径,即使它是正确的,同样的错误正在显示?我卸载并安装了很多次,但还没有得到解决方案。

这是我得到的控制台错误

SEVERE: Unable to start Cucumber
io.cucumber.core.exception.CucumberException: No backends were found. Please make sure you have a backend module on your CLASSPATH.
    at io.cucumber.core.runtime.BackendServiceLoader.get(BackendServiceLoader.java:39)
    at io.cucumber.core.runtime.BackendServiceLoader.get(BackendServiceLoader.java:33)
    at io.cucumber.core.runtime.SingletonRunnerSupplier.createRunner(SingletonRunnerSupplier.java:45)
    at io.cucumber.core.runtime.SingletonRunnerSupplier.get(SingletonRunnerSupplier.java:37)
    at io.cucumber.core.runtime.CucumberExecutionContext.getRunner(CucumberExecutionContext.java:128)
    at io.cucumber.core.runtime.CucumberExecutionContext.runTestCase(CucumberExecutionContext.java:115)
    at io.cucumber.core.runtime.Runtime.lambda$execute$6(Runtime.java:110)
    at java.util.concurrent.Executors$RunnableAdapter.call(Unknown Source)
    at java.util.concurrent.FutureTask.run(Unknown Source)
    at io.cucumber.core.runtime.Runtime$SameThreadExecutorService.execute(Runtime.java:233)
    at java.util.concurrent.AbstractExecutorService.submit(Unknown Source)
    at io.cucumber.core.runtime.Runtime.lambda$run$2(Runtime.java:86)
    at java.util.stream.ReferencePipeline$3$1.accept(Unknown Source)
    at java.util.stream.SliceOps$1$1.accept(Unknown Source)
    at java.util.ArrayList$ArrayListSpliterator.tryAdvance(Unknown Source)
    at java.util.stream.ReferencePipeline.forEachWithCancel(Unknown Source)
    at java.util.stream.AbstractPipeline.copyIntoWithCancel(Unknown Source)
    at java.util.stream.AbstractPipeline.copyInto(Unknown Source)
    at java.util.stream.AbstractPipeline.wrapAndCopyInto(Unknown Source)
    at java.util.stream.ReduceOps$ReduceOp.evaluateSequential(Unknown Source)
    at java.util.stream.AbstractPipeline.evaluate(Unknown Source)
    at java.util.stream.ReferencePipeline.collect(Unknown Source)
    at io.cucumber.core.runtime.Runtime.run(Runtime.java:87)
    at io.cucumber.core.cli.Main.run(Main.java:92)
    at cucumber.api.cli.Main.run(Main.java:30)
    at cucumber.api.cli.Main.main(Main.java:15)

Mar 27, 2021 12:20:49 AM io.cucumber.core.runtime.Runtime run
SEVERE: Exception while executing pickle
java.util.concurrent.ExecutionException: io.cucumber.core.exception.CucumberException: No backends were found. Please make sure you have a backend module on your CLASSPATH.
    at java.util.concurrent.FutureTask.report(Unknown Source)
    at java.util.concurrent.FutureTask.get(Unknown Source)
    at io.cucumber.core.runtime.Runtime.run(Runtime.java:93)
    at io.cucumber.core.cli.Main.run(Main.java:92)
    at cucumber.api.cli.Main.run(Main.java:30)
    at cucumber.api.cli.Main.main(Main.java:15)
Caused by: io.cucumber.core.exception.CucumberException: No backends were found. Please make sure you have a backend module on your CLASSPATH.
    at io.cucumber.core.runtime.BackendServiceLoader.get(BackendServiceLoader.java:39)
    at io.cucumber.core.runtime.BackendServiceLoader.get(BackendServiceLoader.java:33)
    at io.cucumber.core.runtime.SingletonRunnerSupplier.createRunner(SingletonRunnerSupplier.java:45)
    at io.cucumber.core.runtime.SingletonRunnerSupplier.get(SingletonRunnerSupplier.java:37)
    at io.cucumber.core.runtime.CucumberExecutionContext.getRunner(CucumberExecutionContext.java:128)
    at io.cucumber.core.runtime.CucumberExecutionContext.runTestCase(CucumberExecutionContext.java:115)
    at io.cucumber.core.runtime.Runtime.lambda$execute$6(Runtime.java:110)
    at java.util.concurrent.Executors$RunnableAdapter.call(Unknown Source)
    at java.util.concurrent.FutureTask.run(Unknown Source)
    at io.cucumber.core.runtime.Runtime$SameThreadExecutorService.execute(Runtime.java:233)
    at java.util.concurrent.AbstractExecutorService.submit(Unknown Source)
    at io.cucumber.core.runtime.Runtime.lambda$run$2(Runtime.java:86)
    at java.util.stream.ReferencePipeline$3$1.accept(Unknown Source)
    at java.util.stream.SliceOps$1$1.accept(Unknown Source)
    at java.util.ArrayList$ArrayListSpliterator.tryAdvance(Unknown Source)
    at java.util.stream.ReferencePipeline.forEachWithCancel(Unknown Source)
    at java.util.stream.AbstractPipeline.copyIntoWithCancel(Unknown Source)
    at java.util.stream.AbstractPipeline.copyInto(Unknown Source)
    at java.util.stream.AbstractPipeline.wrapAndCopyInto(Unknown Source)
    at java.util.stream.ReduceOps$ReduceOp.evaluateSequential(Unknown Source)
    at java.util.stream.AbstractPipeline.evaluate(Unknown Source)
    at java.util.stream.ReferencePipeline.collect(Unknown Source)
    at io.cucumber.core.runtime.Runtime.run(Runtime.java:87)
    ... 3 more


0 Scenarios
0 Steps
0m0.237s


?????????????????????????????????????????????????????????????????????????????????????
? Share your Cucumber Report with your team at https://reports.cucumber.io          ?
? Activate publishing with one of the following:                                    ?
?                                                                                   ?
? src/test/resources/cucumber.properties:          cucumber.publish.enabled=true    ?
? src/test/resources/junit-platform.properties:    cucumber.publish.enabled=true    ?
? Environment variable:                            CUCUMBER_PUBLISH_ENABLED=true    ?
? JUnit:                                           @CucumberOptions(publish = true) ?
?                                                                                   ?
? More information at https://reports.cucumber.io/docs/cucumber-jvm                 ?
?                                                                                   ?
? Disable this message with one of the following:                                   ?
?                                                                                   ?
? src/test/resources/cucumber.properties:          cucumber.publish.quiet=true      ?
? src/test/resources/junit-platform.properties:    cucumber.publish.quiet=true      ?
?????????????????????????????????????????????????????????????????????????????????????
Exception in thread "main" io.cucumber.core.exception.CucumberException: io.cucumber.core.exception.CucumberException: No backends were found. Please make sure you have a backend module on your CLASSPATH.
    at io.cucumber.core.runtime.CucumberExecutionContext.getException(CucumberExecutionContext.java:82)
    at io.cucumber.core.runtime.Runtime.run(Runtime.java:103)
    at io.cucumber.core.cli.Main.run(Main.java:92)
    at cucumber.api.cli.Main.run(Main.java:30)
    at cucumber.api.cli.Main.main(Main.java:15)
Caused by: io.cucumber.core.exception.CucumberException: No backends were found. Please make sure you have a backend module on your CLASSPATH.
    at io.cucumber.core.runtime.BackendServiceLoader.get(BackendServiceLoader.java:39)
    at io.cucumber.core.runtime.BackendServiceLoader.get(BackendServiceLoader.java:33)
    at io.cucumber.core.runtime.SingletonRunnerSupplier.createRunner(SingletonRunnerSupplier.java:45)
    at io.cucumber.core.runtime.SingletonRunnerSupplier.get(SingletonRunnerSupplier.java:37)
    at io.cucumber.core.runtime.CucumberExecutionContext.getRunner(CucumberExecutionContext.java:128)
    at io.cucumber.core.runtime.CucumberExecutionContext.runTestCase(CucumberExecutionContext.java:115)
    at io.cucumber.core.runtime.Runtime.lambda$execute$6(Runtime.java:110)
    at java.util.concurrent.Executors$RunnableAdapter.call(Unknown Source)
    at java.util.concurrent.FutureTask.run(Unknown Source)
    at io.cucumber.core.runtime.Runtime$SameThreadExecutorService.execute(Runtime.java:233)
    at java.util.concurrent.AbstractExecutorService.submit(Unknown Source)
    at io.cucumber.core.runtime.Runtime.lambda$run$2(Runtime.java:86)
    at java.util.stream.ReferencePipeline$3$1.accept(Unknown Source)
    at java.util.stream.SliceOps$1$1.accept(Unknown Source)
    at java.util.ArrayList$ArrayListSpliterator.tryAdvance(Unknown Source)
    at java.util.stream.ReferencePipeline.forEachWithCancel(Unknown Source)
    at java.util.stream.AbstractPipeline.copyIntoWithCancel(Unknown Source)
    at java.util.stream.AbstractPipeline.copyInto(Unknown Source)
    at java.util.stream.AbstractPipeline.wrapAndCopyInto(Unknown Source)
    at java.util.stream.ReduceOps$ReduceOp.evaluateSequential(Unknown Source)
    at java.util.stream.AbstractPipeline.evaluate(Unknown Source)
    at java.util.stream.ReferencePipeline.collect(Unknown Source)
    at io.cucumber.core.runtime.Runtime.run(Runtime.java:87)
    ... 3 more
4

1 回答 1

1

在尝试解决此错误一周后,我得到了解决方案,在上帝的恩典下,我在 Web 中找到了一个针对不同问题的解决方案,但我为我的问题尝试了它,

只需转到.m2文件夹>>存储库>>删除所有文件然后在eclipse项目>>清理>>所有项目

然后运行项目就成功了

于 2021-03-26T19:46:13.580 回答