在此处输入图像描述我要通过预期状态的发布请求创建否定测试,但我遇到关键字名称不能为空消息。
InvalidPassword Test
[Tags] InvalidPassword
Create Session InvalidPassword ${url_api}/${end_point_login}
Log To Console ${url_api}/${end_point_login}
${body}= Create Dictionary mobile=***** password=****** key=1
${header}= Create Dictionary Accept=application/Json
${response}= POST On Session InvalidPassword ${url_api}/${end_point_login} data=${body} expected_status=422
请参阅 Robot Framework 生成的 report.html 文件来跟踪问题,但是,我从您共享的代码中为您提供了一些提示:
示例:
*** Variables ***
${base_address} base_address of your API
${uri}
Create Session InvalidPassword ${base_address}
POST On Session InvalidPassword ${uri}
或
Create Session InvalidPassword ${base_address}/${uri}
POST On Session InvalidPassword ""
示例:
${response}= POST On Session InvalidPassword ${uri} json=${body} headers=${header} expected_status=422