Import custom library from a different path in Robot Framework

余生颓废 提交于 2019-12-05 14:56:38

There are many ways. For one, just use the path. For example:

*** Settings ***
| Library | ../Custom Libraries/customlibrary.py

Or, you can add Test Library/Custom Libraries to your PYTHONPATH variable and just use the library name itself:

*** Settings ***
| Library | customlibrary

Or, you can set a variable that defines the directory -- either in a variables table or from the command line:

*** Variables ***
| ${LIBRARIES} | Test Library/Custom Libraries

*** Settings ***
| Library | ${LIBRARIES}/customlibrary.py

This is all described in the robot framework user guide, under the section Taking test libraries into use

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!