严重:当我尝试运行功能文件时无法启动 Cucumber 错误

问题描述

我刚刚创建了功能文件和 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

解决方法

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

只需转到.m2文件夹>>存储库>>删除所有文件 然后在 Eclipse Project >> clean >> All project

然后运行项目成功

相关问答

Selenium Web驱动程序和Java。元素在(x,y)点处不可单击。其...
Python-如何使用点“。” 访问字典成员?
Java 字符串是不可变的。到底是什么意思?
Java中的“ final”关键字如何工作?(我仍然可以修改对象。...
“loop:”在Java代码中。这是什么,为什么要编译?
java.lang.ClassNotFoundException:sun.jdbc.odbc.JdbcOdbc...