两种方法:
#py文件中:
from robot.libraries.BuiltIn import BuiltIn
#两个参数:变量名,变量值
BuiltIn().set_global_variable(name, *values)
#RF文件的用户关键字中:
*** Keywords ***
globalval
set global variable name1 value1
原文:https://www.cnblogs.com/Lara1798/p/12941924.html