找不到名称为"$ {body} = Create Dictionary"的关键字 [英] No keyword with name '${body}= Create Dictionary' found
本文介绍了找不到名称为"$ {body} = Create Dictionary"的关键字的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
*** settings ***
Library RequestsLibrary
Library Collections
Library OperatingSystem
Library SeleniumLibrary
*** Variables ***
${username} XXXXXX
${password} YYYYYY
${locale} ZZZZ
*** test cases ***
TC1
${body}= Create Dictionary username= ${username} password= ${password}
${header}= Create Dictionary Accept=application/json, text/plain, */* Content-Type=application/json, Accept-Language=${locale},
Create Session OA2 ${base_url}
${response}= post request OA2 /oauth/v2/token data= ${body} headers= ${header}
log to console ${response.status_code}
log to console ${response.content}
推荐答案
In following code line (and others) you seem to only use 1 space between variable and keyword ${body}= Create Dictionary
.
That's why robot can not parse the code correctly and the error is raised.
Expand that code to use at least 2 space separation.
You should try the code like this.
${body}= Create Dictionary username=${username} password=${password}
当然还要相应地修改其余代码.
And of course revise rest of the code accordingly.
我还建议您阅读用户指南.
它包含许多有用的信息.
I also recommend you study the user guide.
It contains a lot of useful information.
这篇关于找不到名称为"$ {body} = Create Dictionary"的关键字的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文