首页 > 解决方案 > 如何解决黄瓜中的“cucumber.runtime.CucumberException: gherkin.ParserException$CompositeParserException: Parser errors:”问题

问题描述

功能文件:

Feature: Claims Regression suit scenarios using BDD
@Test
Scenario: Log in to AUT as ClaimAssistant with valid credential.
Given Browser is launched successfully

步骤定义文件:

@Given("^Browser is launched successfully$")
    public void Browser_is_launched_successfully() throws InterruptedException, IOException
    {
        System.setProperty("webdriver.chrome.driver", "U:\\Claims Jar\\ChromeDriver\\chromedriver_win32\\chromedriver.exe");
        driver=new ChromeDriver();
        driver.get("https://www.google.com");
        driver.manage().window().maximize();
    }

测试运行器类文件:

package Runner;

import org.junit.runner.RunWith;

import cucumber.api.CucumberOptions;
import cucumber.api.junit.Cucumber;

@RunWith(Cucumber.class)
@CucumberOptions(
        features="Feature",
        glue={"stepDefn"},
        plugin = { "pretty", "html:target/cucumber-reports"},
        tags="@CO_Login_Test_ClaimAssistant"  ,
        dryRun= true ,
        monochrome = true
        )public class TestRunner {}

标签: cucumbercucumber-javacucumber-junit

解决方案


推荐阅读