首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >How To Fix "Expected -specific part at index 10: classpath:“Error While A Feature File In Cucumber-Java

How To Fix "Expected -specific part at index 10: classpath:“Error While A Feature File In Cucumber-Java
EN

Stack Overflow用户
提问于 2019-02-16 01:56:52
回答 2查看 5.4K关注 0票数 1

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

当我尝试运行Runner Class时(使用Cucumber JVM + JUnit)。它运行正常。注意:- Cucumber-Junit,Cucumber-java Jars的版本是4.2.3。JUnit 4.12。

代码语言:javascript
复制
@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

EN

回答 2

Stack Overflow用户

回答已采纳

发布于 2019-02-18 22:56:01

我也遇到了这个问题,在使用Cucumber Java/Junit 4.2.2之后,它工作得很好。

票数 1
EN

Stack Overflow用户

发布于 2019-03-01 05:29:28

您必须下载Cucumber Java / Junit 4.2.0版本,并检查IDE中托管的java版本。

票数 1
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/54714709

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档