Parser error when have multi line comment after data table


#1

When i try to execute the code. it give me this error. can you tell me what’s the wrong with the code

Feature file:

Feature: NewCustomer
Create new customer

@tag1
Scenario : Test_01
Given I am in the guru home page
And I logged as a manager
| userName | password |
| name1 | 5 |
When I navigate to new customer
Then create a new customer successfully

code:

class NewCus {
/**
* The step definitions below match with Katalon sample Gherkin steps
*/
@Given(“I am in the guru home page”)
def I_am_in_the_guru_home_page() {
WebUI.openBrowser(“http://demo.guru99.com/v4/”);
}

@And("I logged as a manager")
def I_logged_as_a_manager(DataTable table) {
	List<Map<String, String>> data =table.asMaps(String.class, String.class);
	System.out.println(data.get(0).get("userName"));
	//WebUI.setText(findTestObject('login/InputUserName'), data[0].userName);
	//WebUI.setText(findTestObject('login/InputPassword'), data[1].password);
	//WebUI.click(findTestObject('login/ButtonLogin'));
}

@When("I navigate to new customer")
def I_navigate_to_new_customer() {
}
@Then("create a new customer succesfully")
def create_a_new_customer_successfully() {
}

}

error

03-26-2019 09:22:30 AM Verification

Elapsed time: 0.684s

Verification FAILED.
Reason:
com.kms.katalon.core.exception.StepFailedException: Keyword runFeatureFile was failed (Root cause: cucumber.runtime.CucumberException: gherkin.ParserException$CompositeParserException: Parser errors:
(24:3): expected: #TagLine, #ScenarioLine, #ScenarioOutlineLine, #Comment, #Empty, got ‘Scenario : Test_01’
(25:5): expected: #TagLine, #ScenarioLine, #ScenarioOutlineLine, #Comment, #Empty, got ‘Given I am in the guru home page’
(26:5): expected: #TagLine, #ScenarioLine, #ScenarioOutlineLine, #Comment, #Empty, got 'And I logged as a manager ’
(27:7): expected: #TagLine, #ScenarioLine, #ScenarioOutlineLine, #Comment, #Empty, got ‘| userName | password |’
(28:7): expected: #TagLine, #ScenarioLine, #ScenarioOutlineLine, #Comment, #Empty, got ‘| name1 | 5 |’
(29:5): expected: #TagLine, #ScenarioLine, #ScenarioOutlineLine, #Comment, #Empty, got ‘When I navigate to new customer’
(30:5): expected: #TagLine, #ScenarioLine, #ScenarioOutlineLine, #Comment, #Empty, got ‘Then create a new customer succesfully’
(34:0): unexpected end of file, expected: #TagLine, #ScenarioLine, #ScenarioOutlineLine, #Comment, #Empty
at cucumber.runtime.model.FeatureBuilder.parse(FeatureBuilder.java:60)
at cucumber.runtime.model.CucumberFeature.loadFromFeaturePath(CucumberFeature.java:112)
at cucumber.runtime.model.CucumberFeature.load(CucumberFeature.java:48)
at cucumber.runtime.model.CucumberFeature.load(CucumberFeature.java:30)
at cucumber.runtime.RuntimeOptions.cucumberFeatures(RuntimeOptions.java:305)
at cucumber.runtime.Runtime.run(Runtime.java:97)
at cucumber.api.cli.Main.run(Main.java:35)
at cucumber.api.cli.Main$run.call(Unknown Source)
at com.kms.katalon.core.cucumber.keyword.CucumberBuiltinKeywords$_runFeatureFile_closure1.doCall(CucumberBuiltinKeywords.groovy:76)
at com.kms.katalon.core.cucumber.keyword.CucumberBuiltinKeywords$_runFeatureFile_closure1.doCall(CucumberBuiltinKeywords.groovy)
at com.kms.katalon.core.keyword.internal.KeywordMain.runKeyword(KeywordMain.groovy:66)
at com.kms.katalon.core.keyword.internal.KeywordMain$runKeyword.call(Unknown Source)
at com.kms.katalon.core.cucumber.keyword.CucumberBuiltinKeywords.runFeatureFile(CucumberBuiltinKeywords.groovy:46)
at com.kms.katalon.core.cucumber.keyword.CucumberBuiltinKeywords$runFeatureFile$0.callStatic(Unknown Source)
at com.kms.katalon.core.cucumber.keyword.CucumberBuiltinKeywords.runFeatureFile(CucumberBuiltinKeywords.groovy:101)
at com.kms.katalon.core.cucumber.keyword.CucumberBuiltinKeywords$runFeatureFile.call(Unknown Source)
at WSVerification1553572350177.run(WSVerification1553572350177:2)
at com.kms.katalon.core.main.ScriptEngine.run(ScriptEngine.java:194)
at com.kms.katalon.core.main.ScriptEngine.runScriptAsRawText(ScriptEngine.java:119)
at com.kms.katalon.core.main.WSVerificationExecutor.runScript(WSVerificationExecutor.java:146)
at com.kms.katalon.core.main.WSVerificationExecutor.doExecute(WSVerificationExecutor.java:140)
at com.kms.katalon.core.main.WSVerificationExecutor.processExecutionPhase(WSVerificationExecutor.java:123)
at com.kms.katalon.core.main.WSVerificationExecutor.accessMainPhase(WSVerificationExecutor.java:115)
at com.kms.katalon.core.main.WSVerificationExecutor.execute(WSVerificationExecutor.java:103)
at com.kms.katalon.core.main.TestCaseMain.runFeatureFile(TestCaseMain.java:144)
at com.kms.katalon.core.main.TestCaseMain$runFeatureFile$0.call(Unknown Source)
at TempTempCase1553572342185.run(TempTempCase1553572342185.groovy:21)
Caused by: gherkin.ParserException$CompositeParserException: Parser errors:
(24:3): expected: #TagLine, #ScenarioLine, #ScenarioOutlineLine, #Comment, #Empty, got ‘Scenario : Test_01’
(25:5): expected: #TagLine, #ScenarioLine, #ScenarioOutlineLine, #Comment, #Empty, got ‘Given I am in the guru home page’
(26:5): expected: #TagLine, #ScenarioLine, #ScenarioOutlineLine, #Comment, #Empty, got 'And I logged as a manager ’
(27:7): expected: #TagLine, #ScenarioLine, #ScenarioOutlineLine, #Comment, #Empty, got ‘| userName | password |’
(28:7): expected: #TagLine, #ScenarioLine, #ScenarioOutlineLine, #Comment, #Empty, got ‘| name1 | 5 |’
(29:5): expected: #TagLine, #ScenarioLine, #ScenarioOutlineLine, #Comment, #Empty, got ‘When I navigate to new customer’
(30:5): expected: #TagLine, #ScenarioLine, #ScenarioOutlineLine, #Comment, #Empty, got ‘Then create a new customer succesfully’
(34:0): unexpected end of file, expected: #TagLine, #ScenarioLine, #ScenarioOutlineLine, #Comment, #Empty
at gherkin.Parser.parse(Parser.java:143)
at gherkin.Parser.parse(Parser.java:118)
at gherkin.Parser.parse(Parser.java:114)
at cucumber.runtime.model.FeatureBuilder.parse(FeatureBuilder.java:56)
… 26 more
)
at com.kms.katalon.core.keyword.internal.KeywordMain.stepFailed(KeywordMain.groovy:48)
at com.kms.katalon.core.keyword.internal.KeywordMain.stepFailed(KeywordMain.groovy)
at com.kms.katalon.core.keyword.internal.KeywordMain.runKeyword(KeywordMain.groovy:68)
at com.kms.katalon.core.keyword.internal.KeywordMain$runKeyword.call(Unknown Source)
at com.kms.katalon.core.cucumber.keyword.CucumberBuiltinKeywords.runFeatureFile(CucumberBuiltinKeywords.groovy:46)
at com.kms.katalon.core.cucumber.keyword.CucumberBuiltinKeywords$runFeatureFile$0.callStatic(Unknown Source)
at com.kms.katalon.core.cucumber.keyword.CucumberBuiltinKeywords.runFeatureFile(CucumberBuiltinKeywords.groovy:101)
at com.kms.katalon.core.cucumber.keyword.CucumberBuiltinKeywords$runFeatureFile.call(Unknown Source)
at WSVerification1553572350177.run(WSVerification1553572350177:2)
at com.kms.katalon.core.main.ScriptEngine.run(ScriptEngine.java:194)
at com.kms.katalon.core.main.ScriptEngine.runScriptAsRawText(ScriptEngine.java:119)
at com.kms.katalon.core.main.WSVerificationExecutor.runScript(WSVerificationExecutor.java:146)
at com.kms.katalon.core.main.WSVerificationExecutor.doExecute(WSVerificationExecutor.java:140)
at com.kms.katalon.core.main.WSVerificationExecutor.processExecutionPhase(WSVerificationExecutor.java:123)
at com.kms.katalon.core.main.WSVerificationExecutor.accessMainPhase(WSVerificationExecutor.java:115)
at com.kms.katalon.core.main.WSVerificationExecutor.execute(WSVerificationExecutor.java:103)
at com.kms.katalon.core.main.TestCaseMain.runFeatureFile(TestCaseMain.java:144)
at com.kms.katalon.core.main.TestCaseMain$runFeatureFile$0.call(Unknown Source)
at TempTempCase1553572342185.run(TempTempCase1553572342185.groovy:21)
Caused by: cucumber.runtime.CucumberException: gherkin.ParserException$CompositeParserException: Parser errors:
(24:3): expected: #TagLine, #ScenarioLine, #ScenarioOutlineLine, #Comment, #Empty, got ‘Scenario : Test_01’
(25:5): expected: #TagLine, #ScenarioLine, #ScenarioOutlineLine, #Comment, #Empty, got ‘Given I am in the guru home page’
(26:5): expected: #TagLine, #ScenarioLine, #ScenarioOutlineLine, #Comment, #Empty, got 'And I logged as a manager ’
(27:7): expected: #TagLine, #ScenarioLine, #ScenarioOutlineLine, #Comment, #Empty, got ‘| userName | password |’
(28:7): expected: #TagLine, #ScenarioLine, #ScenarioOutlineLine, #Comment, #Empty, got ‘| name1 | 5 |’
(29:5): expected: #TagLine, #ScenarioLine, #ScenarioOutlineLine, #Comment, #Empty, got ‘When I navigate to new customer’
(30:5): expected: #TagLine, #ScenarioLine, #ScenarioOutlineLine, #Comment, #Empty, got ‘Then create a new customer succesfully’
(34:0): unexpected end of file, expected: #TagLine, #ScenarioLine, #ScenarioOutlineLine, #Comment, #Empty
at cucumber.runtime.model.FeatureBuilder.parse(FeatureBuilder.java:60)
at cucumber.runtime.model.CucumberFeature.loadFromFeaturePath(CucumberFeature.java:112)
at cucumber.runtime.model.CucumberFeature.load(CucumberFeature.java:48)
at cucumber.runtime.model.CucumberFeature.load(CucumberFeature.java:30)
at cucumber.runtime.RuntimeOptions.cucumberFeatures(RuntimeOptions.java:305)
at cucumber.runtime.Runtime.run(Runtime.java:97)
at cucumber.api.cli.Main.run(Main.java:35)
at cucumber.api.cli.Main$run.call(Unknown Source)
at com.kms.katalon.core.cucumber.keyword.CucumberBuiltinKeywords$_runFeatureFile_closure1.doCall(CucumberBuiltinKeywords.groovy:76)
at com.kms.katalon.core.cucumber.keyword.CucumberBuiltinKeywords$_runFeatureFile_closure1.doCall(CucumberBuiltinKeywords.groovy)
at com.kms.katalon.core.keyword.internal.KeywordMain.runKeyword(KeywordMain.groovy:66)
… 16 more
Caused by: gherkin.ParserException$CompositeParserException: Parser errors:
(24:3): expected: #TagLine, #ScenarioLine, #ScenarioOutlineLine, #Comment, #Empty, got ‘Scenario : Test_01’
(25:5): expected: #TagLine, #ScenarioLine, #ScenarioOutlineLine, #Comment, #Empty, got ‘Given I am in the guru home page’
(26:5): expected: #TagLine, #ScenarioLine, #ScenarioOutlineLine, #Comment, #Empty, got 'And I logged as a manager ’
(27:7): expected: #TagLine, #ScenarioLine, #ScenarioOutlineLine, #Comment, #Empty, got ‘| userName | password |’
(28:7): expected: #TagLine, #ScenarioLine, #ScenarioOutlineLine, #Comment, #Empty, got ‘| name1 | 5 |’
(29:5): expected: #TagLine, #ScenarioLine, #ScenarioOutlineLine, #Comment, #Empty, got ‘When I navigate to new customer’
(30:5): expected: #TagLine, #ScenarioLine, #ScenarioOutlineLine, #Comment, #Empty, got ‘Then create a new customer succesfully’
(34:0): unexpected end of file, expected: #TagLine, #ScenarioLine, #ScenarioOutlineLine, #Comment, #Empty
at gherkin.Parser.parse(Parser.java:143)
at gherkin.Parser.parse(Parser.java:118)
at gherkin.Parser.parse(Parser.java:114)
at cucumber.runtime.model.FeatureBuilder.parse(FeatureBuilder.java:56)
… 26 more


#2

Could you remove the extra space after ‘Scenario’?


#3

still i get the same error


#4

It might not be the same. You need to present the script, the actual result clearly to get help.