Taking Robot Framework 5 into use
Required steps for using Robot Framework 5 features
Updating conda.yaml
to include these minimum package versions will enable the use of all the Robot Framework 5 features.
NOTE. Due to minimum dependency requirements, you NEED to upgrade all the packages you are using from the table to these minimum versions. Otherwise, the environment build will fail!
Minimum package versions needed:
Package | Version | Comment |
---|---|---|
rpaframework | 14.1.1 | |
rpaframework-aws | 2.0.0 | |
rpaframework-dialogs | 2.0.0 | If installed separately. |
rpaframework-google | 4.0.0 | |
rpaframework-pdf | 3.0.0 | If installed separately. |
rpaframework-recognition | 3.0.0 | |
rpaframework-windows | 4.0.0 | If installed separately. |
An example conda.yaml
:
History of Robot Framework major releases
Robot Framework is one of the core languages with which Robocorp RPA robots can be developed. The other one is pure Python. Robot Framework has always been included in the rpaframework package starting from Robot Framework release 3.
The previous major Robot Framework release 4 introduced concepts such as IF-ELSE and FOR loops into the code syntax. These have been in use
since rpaframework
9.0.0 release.
What is new in Robot Framework 5?
Starting from rpaframework
version 14.1.1, the next major Robot Framework release 5 and its features are available for Robot Framework based robots.
List of the most important new features:
- TRY-EXCEPT-FINALLY
- WHILE
- Inline IF statements
- BREAK and CONTINUE
- RETURN
You can find more technical information in Robot Framework 5 release notes.
Migrating an existing robot into Robot Framework 5 syntax
Existing robots do not need to take new features into use, but in some cases, new features make the syntax cleaner and the code itself more robust. For example, when using the TRY-EXCEPT-FINALLY block, there will be a clear section to handle error situations (EXCEPT) and a section to handle closing/teardown actions (FINALLY).
An example of a basic template to catch errors:
Replacing deprecated Exit For Loop (If)
This is an example of deprecated usage:
Using default IF branching with Robot Framework 5:
Using the new inline IF statement with Robot Framework 5:
Replacing deprecated Continue For Loop (If)
This is an example of deprecated usage:
Using default IF branching with Robot Framework 5:
Using the new inline IF statement with Robot Framework 5:
Replacing deprecated Return From Keyword (If)
This is an example of deprecated usage:
Returning with Robot Framework 5:
Replacing deprecated Run Keyword Unless
This is an example of deprecated usage:
Better with Robot Framework 5:
Fixing possible problems with Exit/Continue For Loop
keyword
Using Exit/Continue For Loop
from within a user keyword is no longer supported.
This will NOT work with Robot Framework 5:
Working example (although deprecated). Exit/Continue For Loop
can now be used only directly within FOR loop:
The better implementation with Robot Framework 5:
Fixing possible problems with Run Keyword And Expect Error
keyword
Previously keyword allowed regular expression pattern to match the beginning of the error message. Now the pattern must match the whole error message.
This will NOT work with Robot Framework 5:
This needs to be replaced with:
What should I do if I encounter problems with Robot Framework 5?
Contact us on Developer Slack community so that we can look into the issue.
If something does not seem to work with Robot Framework 5, you can pin the previous version in your conda.yaml
file: