【发布时间】:2018-09-04 17:17:18
【问题描述】:
空手道新手,我已经阅读了大量的空手道教程,但无法理解这个看似微不足道的问题。
我有一个成功列出所有应用程序的发布请求,从响应中我得到第一个应用程序的 ID 并将其打印到控制台,它显示没有问题。但是,当我在下一个场景中使用有效负载中的 applicationId 时(在同一功能文件中,applicationId 不会添加到有效负载中。
Scenario: List all applications
Given path '/ListApplications'
And request {"request":{},"Session":'#(session)'}
When method POST
Then status 200
And def applicationId = response.Applications[0].Id
* print 'Hello ' + applicationId //i see the application id of 7203 here in the console log
Scenario: Get Application
Given path '/GetApplication'
And request {"request":{"ApplicationId":'#(applicationId)'},"Session":'#(session)'}
When method POST //post here just uses string applicationId instead of 7203
Then status 200
非常感谢任何帮助
【问题讨论】:
标签: karate