Karate API - 无法传递路径中的变量值

问题描述 投票:0回答:1

我尝试传递 AppraisalID 的变量值,但无法识别。请帮忙

Given path '/products/propertyedge/appraisal'
    And request '{"valuationId":"372629"}'
    When method Post
    Then status 201
    * def location = responseHeaders['Location'][0]
    * def appraisalId = location.substring(location.lastIndexOf('/') + 1)
    * print appraisalId
    Given path 'products/propertyedge/appraisal/{appraisalId}'
    And param action = 'view'
    When method Get
    Then status 200
    And assert response.appraisalId == <appraisalId>

回应: response

#空手道#api

尝试使用场景大纲变量<>但徒劳。请帮忙

karate
1个回答
1
投票

请阅读文档:https://github.com/karatelabs/karate#path

Given path 'products/propertyedge/appraisal', appraisalId
© www.soinside.com 2019 - 2024. All rights reserved.