机械手框架工作错误导入测试库'Requestslibrary'失败:ModuleNotFoundError:没有名为'Requestslibrary'和'JSONlibrary'的模块

时间:2020-08-11 19:49:25

标签: robotframework

我有两个文件,一个用于关键字,另一个用于运行实际的测试用例

testkeywords.robot

*** Settings ***
Library  Requestslibrary
Library  JSONlibrary
Library  Collections

*** Variables ***
${Base_URL}  http://www.thetestingworldapi.com/

*** Keywords ***
Get Student Name
    [Arguments]  ${id}
    create session  Get_student_details  ${base_url}
    ${response}=    get request  Get_student_details  api/studentsDetails/${id}
    #log to console  ${response.content}
    ${json_res}=    to json  ${response.content}
    #log to console  ${json_res}
    @{first_name_list}=  get value from json  ${json_res}  data.first_name
    ${first_name}=  get from list  ${first_name_list}  0
    [return]  ${first_name}



sample.robot



*** Settings ***
Library  RequestsLibrary
Library  JSONLibrary
Library  Collections
Resource  Resources/testkeywords.robot

*** Variables ***
${id}  56841

*** Test Cases ***
TC_01
    Get Student Name  ${id}

我收到错误错误“导入测试库'Requestslibrary'失败:ModuleNotFoundError:没有名为'Requestslibrary'的模块”

但是导入相同的库时,示例文件却没有任何问题

0 个答案:

没有答案