由于使用ride编辑rf文件随着用例的增多,执行数量较多时,ride很容易不稳定,因此采取直接 pycharm+rf的编辑方式
在自定义.py文件作为Library时,执行用例出现报错.py 文件找不到对应的关键字
[ ERROR ] Error in file '/Users/sailor/code/python_Rf_Demo/keywords/address_book/member.robot' on line 2: Importing library '/Users/sailor/code/python_Rf_Demo/api/address_book/Member.py' failed:
ModuleNotFoundError: No module named 'Member'
Traceback (most recent call last):
根据rf官方介绍,自定义类文件作为Library时,类名需要与模块名保持一致。
http://robotframework.org/robotframework/latest/RobotFrameworkUserGuide.html#toc-entry-297
A limitation of this approach is that libraries implemented as Python classes must be in a module with the same name as the class.
即 库的类名必须与文件名相同