robotframework - 机器人框架工作错误导入测试库“Requestslibrary”失败:ModuleNotFoundError:没有名为“Requestslibrary”和“JSONlibrary”的模块
问题描述
我有两个文件,一个用于关键字,另一个用于运行实际的测试用例
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的模块”
但是在导入相同的库时,示例文件没有任何问题就被破坏了
解决方案
推荐阅读
- c# - Nuget添加应用程序中已经存在的相同包
- c++ - nvcc 致命:找不到 Visual Studio 配置文件“vsvars32.bat”(VS 2017)
- java - 如何编写基于事件的单线程程序?
- jmeter - 如何对密码加密的应用程序进行性能测试
- android - View必须有android数据绑定的标签错误
- java - RedHat + MySQL + Tomcat:错误 1040:连接太多(但在 Ubuntu 上一切正常)
- c++ - 赋值运算符重载
- angular - 将 Angular 组件注入到 FullCalendar 事件条目中
- css - Primefaces 日历不会重新调整其在窗口旋转时的位置
- java - Java - 仅返回 Else 子句的 IF 语句