RF内置Build-in变量

本文详细介绍了Robot Framework中可用的内置变量,包括与操作系统相关的变量、测试案例相关的变量等。这些变量有助于自动化测试脚本的编写与维护,适用于各种场景如获取路径、记录测试状态等。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >



Available operating-system-related built-in variables
VariableExplanation
${CURDIR}An absolute path to the directory where the test datafile is located. This variable is case-sensitive.
${TEMPDIR}An absolute path to the system temporary directory. In UNIX-likesystems this is typically /tmp, and in Windowsc:\Documents and Settings\<user>\Local Settings\Temp.
${EXECDIR}An absolute path to the directory where test execution wasstarted from. New in Robot Framework 2.1.
${/}The system directory path separator. / in UNIX-likesystems, \ in Windows.
${:}The system path element separator. : in UNIX-likesystems and ; in Windows.

VariableExplanationAvailable
${TEST NAME}The name of the current test case.Test case
@{TEST TAGS}Contains the tags of the current test case inalphabetical order.Test case
${TEST STATUS}The status of the current test case, either PASS orFAIL.Test teardown
${TEST MESSAGE}The possible error message of the current test case.Test teardown
${PREV TEST NAME}The name of the previous test case, or an empty stringif no tests have been executed yet.Everywhere
${PREV TEST STATUS}The status of the previous test case: either PASS,FAIL or an empty string when no tests have beenexecuted.Everywhere
${PREV TEST MESSAGE}The possible error message of the previous test case.Everywhere
${SUITE NAME}The full name of the current test suite.Everywhere
${SUITE SOURCE}An absolute path to the suite file or directory. Newin Robot Framework 2.5.Everywhere
${SUITE STATUS}The status of the current test case, either PASS orFAIL.Suite teardown
${SUITE MESSAGE}The full message of the current test suite, includingstatistics.Suite teardown
${OUTPUT FILE}An absolute path to the current output file. Hasdifferent values during execution whenoutputs are split.Everywhere
${LOG FILE}An absolute path to the current log file or stringNONE when no log file is created. Has different valuesduring execution when outputs are split.Everywhere
${REPORT FILE}An absolute path to the report file or string NONEwhen no report is created.Everywhere
${SUMMARY FILE}An absolute path to the summary file or string NONEwhen no summary is created.Everywhere
${DEBUG FILE}An absolute path to the debug file or string NONEwhen no debug file is created.Everywhere
${OUTPUT DIR}An absolute path to the output directory.Everywhere
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值