gpt4 book ai didi

java - 如何修复在 Cucumber-Java 中运行功能文件时出现的 "Expected scheme-specific part at index 10: classpath: "错误

转载 作者:行者123 更新时间:2023-11-30 01:55:22 25 4
gpt4 key购买 nike

我正在尝试运行我的功能文件。在 Eclipse 中作为 Cucumber 功能运行。但我遇到了错误。

当我尝试运行 Runner 类时(使用 Cucumber JVM + JUnit)。它运行良好。注意:- Cucumber-Junit、Cucumber-java Jars 的版本为 4.2.3。 JUnit 4.12。

@Smoke
Feature: Google homepage Functionality.

Scenario: Google homepage.
Given I open a browser
When I navigate to url
Then Homepage should open
And Search box should be present
But No search result.



Runner Class :-
@RunWith(Cucumber.class)
@CucumberOptions(
features = "./src/test/resources/GoogleSearch.feature",
glue = "Impl",
plugin = { "pretty",
"html:target/cucumber-htmlreport.html",
"json:target/cucmber-report.json" },
tags= {"@Learn"}
)
public class GoogleRunner {

}


On Running feature file
Error :-
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

代码:https://github.com/kwishna/Cucumber_1

最佳答案

我也遇到了这个问题,使用 Cucumber Java/Junit 4.2.2 后它工作正常。

关于java - 如何修复在 Cucumber-Java 中运行功能文件时出现的 "Expected scheme-specific part at index 10: classpath: "错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/54714709/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com