Getting keyword undefined error after installing robot framework 5.0.1

I am trying to use Try Catch inside keyword but I am getting keyword undefined error. I have already installed 5.0.1 version using— pip install robotframework 5.0.1

Probably that IDE is not yet updated to the new version.

Did the execution went OK?

(Note: Maybe you should post more context when asking questions here :wink: )

I am using PyCharm 2021.3.3 (Community Edition). Please let me know does robot framework 5.0.1 depends on IDE. Which update do I need install.

As I have to use try -catch in robot keyword so in case failure I have to call one API to do something.

Hence I have installed pip install robotframework 5.0.1 and when I am trying to add keyword TRY EXCEPT then it saying undefined keyword.

Same purpose I tried use -
Run Keyword And Return Status so that In case of keyword status fail I should Call API. This case is working but again at the end I have to fetch entire TEST_STATUS and based on PASS or FAIL I have to call two different API in tear down.

If I used - Run Keyword And Return Status then using TEST_STATUS always getting PASS result.

IF I used just- Wait Until Element Is Visible ${heading_successful_xpath}
Then in TEST_STATUS it giving FAIL if above keyword is really failed.

pip install --upgrade robotframework
pip install robotframework==5.0.1
pip install --upgrade robotframework
robot --version
pip show robotframework
Installed correctly 5.0.1

Please let me know If this info is not enough to understand my problem

Any update on above issue. Why I am not able to use TRY EXCEPT in robot 5.0.1?

Hi @bk-user,

I don’t use PyCharm, I doubt @HelioGuilherme66 does either, but his answer is correct that your IDE (PpCharm) needs to support the new robot framework functionality for it to work as you expect in the IDE.

You can always use the new functionality outside the IDE, but then whats the point of using an IDE at all?

I did a quick search and found that the robot framework plugin for PyCharm was last updated at the beginning of January, which was well before robot framework version 5 was released, so you will need to wait till that plugin has been updated to support robot framework 5 functionality.

Also when I checked the issues page for that plugin I didn’t see any open issue for robot framework 5 functionality, I did however see an open issue for Support for Robot Framework 3.1 FOR loop syntax so it might be a while before that plugin supports this new functionality, but there is no harm raising an issue for them to add it, just don’t expect it quickly (or if you need it urgently, you might want to discuss with that project how you can help i.e. funding).

The other alternative is to use an IDE that already has the robot framework 5 functionality, I don’t know which ones have. I personally don’t use an IDE so can’t recommend one.


Hello Helio. It is not a matter of updating the IDE. It is necessary to share the correct configuration to make try/catch work and in the process share exercises or real examples to continue strengthening Robotframework. Thank you very much and we were very attentive to the solution. :slight_smile:

I posted a link to the documentation in another post, and it is all there.

Thanks Helio for the reply. However, despite following all the indications, it still does not work :frowning: If it is possible to share a practical exercise, stay tuned.

The example is in the documentation.
When you say it does not work, are you talking about robot test execution, or IDE code highlight?

The important thing is the code/test execution, the rest is decoration :).