Selenium 要素文件指向不存在的项目

Selenium 要素文件指向不存在的项目,selenium,cucumber,Selenium,Cucumber,我正在为我的应用程序编写一个Cumber TestNG-Selenium框架。我能够从Runner类执行测试用例,但当我试图通过功能文件执行测试用例时,我得到一个错误,它指向某个不存在的项目。 上面是功能文件的运行方式配置属性的快照,类路径中存在错误 当我删除此文件并创建新文件时,出现以下错误: Exception in thread "main" java.lang.IllegalArgumentException: Expected scheme-specific part at inde

我正在为我的应用程序编写一个Cumber TestNG-Selenium框架。我能够从Runner类执行测试用例,但当我试图通过功能文件执行测试用例时,我得到一个错误,它指向某个不存在的项目。

上面是功能文件的运行方式配置属性的快照,类路径中存在错误

当我删除此文件并创建新文件时,出现以下错误:

Exception in thread "main" java.lang.IllegalArgumentException: Expected scheme-specific part at index 10: classpath:
    at java.net.URI.create(URI.java:852)
    at io.cucumber.core.model.GluePath.parseAssumeClasspathScheme(GluePath.java:54)
    at io.cucumber.core.model.GluePath.parse(GluePath.java:34)
    at cucumber.runtime.RuntimeOptions.parse(RuntimeOptions.java:160)
    at cucumber.runtime.RuntimeOptions.<init>(RuntimeOptions.java:107)
    at cucumber.runtime.RuntimeOptions.<init>(RuntimeOptions.java:100)
    at cucumber.runtime.RuntimeOptions.<init>(RuntimeOptions.java:96)
    at cucumber.runtime.Runtime$Builder.withArgs(Runtime.java:131)
    at cucumber.runtime.Runtime$Builder.withArgs(Runtime.java:127)
    at cucumber.api.cli.Main.run(Main.java:22)
    at cucumber.api.cli.Main.main(Main.java:8)
Caused by: java.net.URISyntaxException: Expected scheme-specific part at index 10: classpath:
    at java.net.URI$Parser.fail(URI.java:2848)
    at java.net.URI$Parser.failExpecting(URI.java:2854)
    at java.net.URI$Parser.parse(URI.java:3057)
    at java.net.URI.<init>(URI.java:588)
    at java.net.URI.create(URI.java:850)
    ... 10 more
线程“main”java.lang.IllegalArgumentException中的异常:索引10处的预期方案特定部分:类路径:
在java.net.URI.create(URI.java:852)
位于io.cumber.core.model.GluePath.parseAssumeClasspathScheme(GluePath.java:54)
位于io.cumber.core.model.GluePath.parse(GluePath.java:34)
atcumber.runtime.RuntimeOptions.parse(RuntimeOptions.java:160)
atcumber.runtime.RuntimeOptions.(RuntimeOptions.java:107)
在cucumber.runtime.RuntimeOptions.(RuntimeOptions.java:100)
atcumber.runtime.RuntimeOptions.(RuntimeOptions.java:96)
atcumber.runtime.runtime$Builder.withArgs(runtime.java:131)
atcumber.runtime.runtime$Builder.withArgs(runtime.java:127)
位于cucumber.api.cli.Main.run(Main.java:22)
位于cucumber.api.cli.Main.Main(Main.java:8)
原因:java.net.URISyntaxException:索引10处的预期方案特定部分:类路径:
在java.net.URI$Parser.fail(URI.java:2848)
位于java.net.URI$Parser.failExpecting(URI.java:2854)
位于java.net.URI$Parser.parse(URI.java:3057)
位于java.net.URI。(URI.java:588)
创建(URI.java:850)
... 10多
我能够通过testng.xml和Cucumber Runner文件执行测试用例

请让我知道如何解决此错误


转到Cucumber Feature Runner选项卡,然后检查是否相应设置了以下三个字段

  • 项目,
  • 特征路径
  • 胶水

  • 如果您正确地设置了all,那么它应该不会出现任何错误。

    我也遇到了同样的错误。如果您使用的是Cucumber v4.2.3。使用v4.2.2并重试。对我来说,它起作用了。

    设置完成。在上面的问题中添加了相同的快照。如果使用上述设置执行,则会出现以下错误:线程“main”中出现异常java.lang.IllegalArgumentException:不支持的方案:C:/Users/212743214/EclipseWorkspaceVA/CC/src/test/java/features/Administration/ExportDatabase.feature at cucumber.runtime.io.MultiLoader.resources(MultiLoader.java:28)at Cumber.runtime.model.FeatureLoader.loadFromFeaturePath(FeatureLoader.java:41)我猜在cucumber.runtime.model.FeatureLoader.load(FeatureLoader.java:35)中,项目类路径没有设置。请设置它,然后再试一次。我不知道如何做或如何检查。请您解释一下,或者共享一个相关链接。转到构建路径并设置类路径您的意思是说应该转到Java构建路径和链接源的源选项卡吗?