Cucumber 空手道API测试-逃逸'';在功能文件的url中

Cucumber 空手道API测试-逃逸'';在功能文件的url中,cucumber,gherkin,cucumber-java,karate,Cucumber,Gherkin,Cucumber Java,Karate,我使用空手道API框架中的path关键字连接字符串以形成url。但是,我不能通过“?”。以下是我正在做的: Background: * url 'https://api.cloud.abcde.com/animal/' Scenario: Verify the get status Given path 'herbivore?id=25' When method get Then status 200 当我运行测试时,我看到“?”作为%3F通过。我试图用

我使用空手道API框架中的path关键字连接字符串以形成url。但是,我不能通过“?”。以下是我正在做的:

 Background: 
    * url 'https://api.cloud.abcde.com/animal/'

 Scenario: Verify the get status
    Given path 'herbivore?id=25'
    When method get
    Then status 200
当我运行测试时,我看到“?”作为%3F通过。我试图用\来逃避它,也尝试了一些其他的答案,但没有成功。我需要使用url编码吗?任何指点或帮助都将不胜感激。
谢谢

对于这种情况,您应该使用
param

Scenario: Verify the get status
    Given path 'herbivore'
    And param id = 25
    When method get
    Then status 200

不确定,但您是否尝试过双反斜杠\\…@Grasshopper-它在空手道框架中不起作用我收到错误步骤参数id没有匹配的粘合代码。@Saurabh一定还有其他问题。下面是一个您可以参考的示例:谢谢您的帮助。如果您遇到@Saurabh错误,请记住在查询参数名称、相等运算符和值之间留空格。例如,id=25将失败。id=25是正确的方法。