获取键入机器人框架

时间:2017-03-06 05:10:52

标签: python automated-tests robotframework

你能告诉我如何在Robot Framework中获取变量类型。

${ABC}  Set Variable    Test
${XYZ}  Set Variable    1233

备注:获取变量Type,如string,int

获取$ {ABC} type = string

获取$ {XYZ} type = int

2 个答案:

答案 0 :(得分:7)

这就是我使用的:

${type} =    Evaluate    type($temp).__name__

注意:使用全局字符串/ int / float / list / dict / ...示例进行比较比硬编码类型值更好,因为它们可能因构建而异。

答案 1 :(得分:3)

你可以做到,例如这个: ${type_ABC} Evaluate type($ABC)

相关问题