Cannot use new variables from *.py file


I do my first steps with Robot Framework in PyCharm.
I have some variables in a file and use them in test.robot file:

*** Settings ***

Variables …/

This is working for existing variables.
The problem is for new created or changed variables . I cannot us them as expected. They are marked as undefined in the robot file. I have to restart the IDE to get them known in the robot file.
Any idea how to solve?

Thanks, Rüdiger

Hi Rüdiger,

Can you include your putting a comment next to a variable that is not working as expected and the and a variable that that is working so we can have a chance of figuring out what is happening.


Hi Dave, I think attaching the variable file wouldn’t make it any clearer.
I have a file containing css and/or xpath locator, e.g:

SEND_MESSAGE = ‘text=file_upload’
OTP_REQUEST = ‘button:has-text(“OTP anfordern”)’

I use this variables in a robot file, e.g.:

*** Settings ***
Library Browser
Variables …/locator/

*** Keywords ***
Send Test

Now I add a new variable to the Problem: I cannot use the new variable in robot file. It is marked as undefined until I restarted pyCharm. I think it is a pyCharm problem. Configuration?


To me this would indicate that the issue is within your IDE (pycharm) and the issue would not happen during actual test/task run. And if thats the case, there’s pretty much robot specific that could be done here because its the pycharm that doesn’t reload / reinterpret the variable file if/when its modified…

My suggestions: try vscode with robotframework lsp or don’t rely on IDE hints …

1 Like

Yes, you are right. No problem for test run. I hope there is a configuration in pyCharm/RobotFramework plugin to detect changes in python library and trigger reload / reinterpret…

What plugin are you using? I suggest only using the “Robot Framework Language Server” plugin as your plugin for RF in Pycharm.

Yes, I use only this plugin.