Getting “required (…)+ loop did not match anything at input 'Scenario:'” error when using Background section in cucumber

醉酒当歌 提交于 2019-12-24 03:07:48

问题


I am writing a Karate DSL test to test a web service end point. I have defined my url base in karate-config.js file already. But when I try to use this in the Background section, I am getting the below error. Please help. Provided my feature file below.

Error: "required (...)+ loop did not match anything at input 'Scenario:'"

Feature: Test Data Management service endpoints that perform different operations with EPR

    Background:
     url dataManagementUrlBase

    Scenario: Validate that the contractor's facility requirements are returned from EPR
    Given path 'facilities'
    And def inputpayload = read('classpath:dataManagementPayLoad.json')
    And request inputpayload
    When method post
    Then status 200
    And match $ == read('classpath:dataManagementExpectedJson.json')

回答1:


You are missing a * before the url

Background:
* url dataManagementUrlBase


来源:https://stackoverflow.com/questions/46816265/getting-required-loop-did-not-match-anything-at-input-scenario-error

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!