Error when running Robocorp plugin on PyCharm

Unresolved library: Selenium2LibraryExtended. Error generating libspec: Initializing library ‘Selenium2LibraryExtended’ with no arguments failed: RobotNotRunningError: Cannot access execution context

I see the above error message when running RobotFramework on PyCharm. I have setup virtual environment and I have updated my Project Structure to point to the correct resources folder, but still see the same error message.

I wouldn’t be suprised the error would be because of “Selenium2Library” or what ever project provides the “extended” part. See;


But anyway, the issue is most likely this;

In order for LSP (what you refer to “robocorp plugin” most likely) to know what sort of keywords the library has, it will try to make an instance of that class… If the class is written in a way that requires running robot framework instance , error like you see here (RobotNotRunningError) is thrown by the library itself.

So, Issue is 99% sure in in this Selenium2LibraryExtended library itself and how it is implemented is not supporting how LSP will try to instrospect it.

Still my suggestions is; Ditch Selenium2Library and follow the instructions on the migration guide linked above.

1 Like

If you are using a Virtual Environment, you also need to tell the Robot Framework Language Server extension to use that Python Environment.
It is possible that you are still using your “global” python by accident.

1 Like