View on GitHub

RED - Robot Editor

Eclipse based editor for RobotFramework testcases

RED - Robot Editor User Guide > User guide > Project configuration >

Dealing with libraries absolute paths

When library is added to red.xml RED will check if it is located in workspace or not. Depending on the outcome it will be written with workspace-relative path or absolute one. The problem with the latter is that it is not portable between different users and/or systems. This commonly happens for libraries installed into site-packages using pip:

Solution

Solution to this problem is to combine resources linking and path variables so that the path in red.xml will use relative path to linked location. In such setup there would be no absolute paths used by red.xml thus making it easier to be shared across different users. In order to achieve that:

  1. Open General -> Workspace -> Linked Resources preference page,

  2. create new variable and make it point to e.g. site-packages:

  3. choose New -> Folder from context menu in chosen location somewhere inside your project,

  4. expand Advanced >> button and choose Linked Folder,

  5. use SITE_PACKAGES variable and append location of SeleniumLibrary directory,

  6. now the link will be created resulting in link entry in .project file (no directory is created in the project) and the directory should be visible in Project Explorer,

  7. finally the entry in red.xml can be changed (this has to be done manually) to use workspace relative path to the linked file:

The steps above make the project portable between different machines - there is only relative path inside red.xml plus parameterized entry inside .project file. The only thing that needs to be done is to define SITE_PACKAGES variable accordingly for different project users.