问题
*** 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}
回答1:
You must follow space separated format.
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.
来源:https://stackoverflow.com/questions/64010906/no-keyword-with-name-body-create-dictionary-found