*** Settings ***
Library Collections
Library RequestsLibrary
Library requests
# Declare Test case
*** Test Cases ***
Get Requests2
${resp2}= Get http://services.groupkt.com/country/get/iso2code/IN
${convert_to_json2}= set variable ${resp2.json()}
log to console ${convert_to_json2}
答案 0 :(得分:1)
库可能都包含相同的关键字,或者它们都有一个使用相同名称的关键字。为了识别您要调用的关键字,Robot Framework需要在其关键字命名空间中只包含唯一的名称。
如错误所示,您可以在关键字名称前添加库名称前缀,以允许Robot Framework区分这两个关键字:
*** Test Cases ***
Get Requests2
${resp2}= RequestsLibrary.Get http://services.groupkt.com/country/get/iso2code/IN
${convert_to_json2}= set variable ${resp2.json()}
log to console ${convert_to_json2}
或者,
*** Test Cases ***
Get Requests2
${resp2}= requests.Get http://services.groupkt.com/country/get/iso2code/IN
${convert_to_json2}= set variable ${resp2.json()}
log to console ${convert_to_json2}