【发布时间】:2017-03-16 08:44:29
【问题描述】:
见下面的代码,特别是数据部分。机器人不喜欢这样。
*** Test Cases ***
Add Patient
Log Add Patient
[Tags] Add_Patient
${number}= Generate Random Number ${4}
${data}= {"patients": [ new "sponsor": "test1", "protocol": "Blue18-B18VP1","site_number": "1001","integration_id": int_id_${number},"subject_number": "RT0001","subject_status": "T","randomization_date": "01Jan2017", "treatment_id": "B18VP2"} ]}
Create Session sw3 ${ENVIRONMENT_TO_RUN_AGAINST} debug=3
${resp}= Post Request sw3 ${ENVIRONMENT_TO_RUN_AGAINST}/api/v1/test1/patients
\ ... Content-Type:application/json
\ ... Authorization:authkey02 Accept=application/json
\ ... data=${data}
报错如下:
Creating keyword failed: No keyword with name '{"patients": [ new "sponsor": "test1", "protocol": "Blue18-B18VP1","site_number": "1001","integration_id": int_id_${number},"subject_number": "RT0001","subject_status": "T","randomization_date": "01Jan2017", "treatment_id": "B18VP2"} ]}' found.
【问题讨论】:
-
你希望
new "sponsor"做什么,或者这是一个错字?
标签: rest robotframework