Robot Framework: access Robot's global variables from Python library code?

前端 未结 1 1876
温柔的废话
温柔的废话 2020-12-17 14:46

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          


        
1条回答
  •  再見小時候
    2020-12-17 15:26

    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}")
    

    0 讨论(0)
提交回复
热议问题