如果我将字符串传递${varName}
给内置关键字Log to Console
,控制台将输出文字字符串${varName}
。如果有一个命名的变量varName
具有的价值test123
,我怎么关键字Log to Console
输出的变量值test123
,当我通过${varName}
?
我正在从 Excel 电子表格制作数据驱动的脚本。在我传入的字符串值中,我想用变量的值替换其中的变量名称。
我试图通过Evaluate
关键字运行字符串,但它只是改变了所有变量名,比如${varName}
to RF_VAR_varName
,所以它在这里识别出一些东西?
Open Excel ${ExcelFile}
${varName} Read Cell Data By Coordinates ${Sheet_Name} 0 ${RowNum}
set global variable ${varName}
log varName: ${varName} console=yes
将输出到控制台: '38773461|${TMS_ConfNo}|substr:RDSJUMHV FIRSTNAME|${globalLastName} FIRSTNAME|fullline:JEYCTINY, FIRSTNAME|${globalLastName1}, FIRSTNAME|fullline:RDSJUMHV, FIRSTNAME|${globalLastName}, FIRSTNAME|fullline'
我想要这个字符串: '38773461|${TMS_ConfNo}|substr:RDSJUMHV FIRSTNAME|${globalLastName} FIRSTNAME|fullline:JEYCTINY, FIRSTNAME|${globalLastName1}, FIRSTNAME|fullline:RDSJUMHV, FIRSTNAME|${globalLastName}, FIRSTNAME|fullline'
对此进行评估: '38773461|12345678|substr:RDSJUMHV FIRSTNAME|LASTNAME FIRSTNAME|fullline:JEYCTINY, FIRSTNAME|LASTNAME1, FIRSTNAME|fullline:RDSJUMHV, FIRSTNAME|LASTNAME, FIRSTNAME|fullline'
我希望字符串中的所有变量都转换为它们各自的值。
杨魅力
相关分类