【发布时间】:2019-06-20 01:56:43
【问题描述】:
当我运行此测试时(即测试网站中的登录页面,我得到“No keyword with name &{headers}= Create Dictionary found”。如何使此测试正确运行?
我之前已经安装了所有导入的库,并且在其他测试中使用过它们,所以我知道它们已正确安装。
*** Settings ***
Library Collections
Library RequestsLibrary
Library OperatingSystem
*** Variables ***
${authToken}
${username} example.user@email.com
${password} password
*** Test Cases ***
Log in Dashboard
&{data}= Create Dictionary email=${username} password=${password}
&{headers}= Create Dictionary Accept=application/json, text/plain, */* Content-Type=application/json Origin=http://examplesite.com Referer=http://examplesite.com/angular/
Create session example http://examplesite.com
${response}= Post Request example /admin/login data=${data} headers=${headers}
log ${response}
log ${response.json()}
${allocation_response}= To Json ${response.content}
Set Global Variable
【问题讨论】:
标签: automated-tests robotframework