我正在为我的应用程序编写一个Cucumber-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我能够通过testng.xml和Cucumber Runner文件执行测试用例。
请告诉我如何解决这个错误。


发布于 2019-02-21 17:33:13
我也犯了同样的错误。如果您正在使用Cucumber v4.2.3。使用v4.2.2并尝试。对我来说很管用。
发布于 2019-02-18 09:29:27
转到Cucumber Feature选项卡,然后检查以下三个字段是否相应设置。
如果设置正确,则应该执行,不会出现任何错误。
https://stackoverflow.com/questions/54742205
复制相似问题