Skip to content Skip to sidebar Skip to footer

Robot Framework: Access Robot's Global Variables From Python Library Code?

I have some settings-type global vars that I'd like to be able to access from Python code. For example: pybot --variable RESULTS_PATH:/wherever/this/points test.txt Now, my module

Solution 1:

You will want to use rf's BuiltIn library, for reference read the documentation as found here. This provides the keywords that are built into Robot Framework and so should reliably stay usable:

from robot.libraries.BuiltIn import BuiltIn
results_path = BuiltIn().get_variable_value("${RESULTS_PATH}")

Post a Comment for "Robot Framework: Access Robot's Global Variables From Python Library Code?"