Custom python Library created and imported in robot framework is not recognized

I added a custom python library using python file and imported it in the robot framework. It is working fine and test case passes. But custom keyword inside robot framework are not shown as python file on hovering, it is not recognized in the robot.
image

Hi Ann,

This is not an issue related to robot framework itself but the editor you’re using or a plugin to your editor that does the highlighting and syntax checking.

You didn’t say which editor your using so you’ll need to mention that and hopefully someone that uses that editor will be able to help.

Dave.

Thanks Dave. I have 2 editor plugins added in my pycharm. IntelliBot#patched and robot Framework Language Server.

Hi Ann,

Hopefully someone who uses pycharm can chime in and help you.

Dave.

I know that with VS Code & Robocorp’s LSP, you may need to add additional Python library paths for it to recognize your custom library (see 4th bullet down on this page). As already mentioned, your issue isn’t with Robot Framework per se, but rather with your IDE and plugins.

It’s probably a path issue. In my opinion, those are best resolved by making your custom libraries actual Python packages and installing them in your venv like any other package. You don’t have to use relative paths while importing them in that case and language servers will always detect them.
More info can be found here: GitHub - robinmackaij/robotframework-poetry-demo: A package to demonstrate how poetry can be used to distribute Robot Framework resources within an organization

1 Like

Check to see if your Robot Options help with this. I have my “Max Transitive…” set to 99.

I dont see that ‘robot option’ in my settings page.

Hmmm, ok, stepping back then. What Plugins do you have installed? The Robot Options is related to IntelliBot #patched.

I have installed plugin - Robot framework language server

@UITester your issue got resolved?