Search code examples
pythonimportrobotframeworklibraries

robot framework equivalent of "from dir1.dir2 import file " in python


Hi I am new to robot frame work so in my local library's I have a file which is encapsulated in two directories , i want to access some functions form that file so how can I import that as a library in my robot test suit

libraries/dir1/dir2/file.py -- is the file path (in python files)>

tried to add it as library with > """dir1.dir2.file """ --but it throws an error >


Solution

  • You can do the following on top of your code

    *** Settings ***
    Documentation      My Robot Tests
    
    Library     folder1/folder2/file.py