我想将 ${Username}
值存储在输出文件中:
例如。如果 ${Username}
等于 0401190926729000
,则该值将存储在文件中。
最佳答案
这是一个提议:
*** Settings ***
Library OperatingSystem
Library String
*** test cases ***
write_variable_in_file
${Username} = Generate Random String 1 abc
log to console ${Username}
run keyword if '${Username}' == 'a' write_variable_in_file ${Username}
*** Keywords ***
write_variable_in_file
[Arguments] ${variable}
Create File ${EXECDIR}/file_with_variable.txt ${variable}
关于robotframework - 如何将变量写入文件?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/29397198/