Python interpreter path not working for resource file with PyCharm and Robot Framework Language Server-plugin

Viewed 20

I am trying to get following Robot Framework project structure to work with PyCharm and Robot Framework Language Server-plugin installed on Ubuntu 20.04.

suite.robot

*** Settings ***
Resource    keywords.resource

*** Test Cases ***
TC01
   Create Folder
   Remove Folder

keywords.resource

*** Settings ***
Library    UserKeywords.py

UserKeywords.py

import os

def create_folder():
    os.mkdir("/home/ubuntu/testfolder")

def remove_folder():
    os.rmdir("/home/ubuntu/testfolder")

Problem is that file keywords.resource is not found in suite.robot although I have added resources and libraries folders to python interpreter path settings in PyCharm as screenshot below shows. For UserKeywords.py library line in keywords.resource this error is not given at the same time though which seems a bit strange. enter image description here

Also in project structure settings marked resources and libraries as sources. enter image description here

enter image description here enter image description here

If I give relative path like below then test suite passes and error is not seen.

suite.robot

*** Settings ***
Resource    ../resources/keywords.resource

enter image description here Relative path is not a problem with a small project like this but with a bigger project having lots of files it would help a lot to only give the file name without relative paths.

Any ideas which settings should be edited or additional settings that could be possibly tried? I have restarted PyCharm after editing python interpreter path and project structure.

0 Answers
Related