简体   繁体   English

获取键入机器人框架

[英]Get Type in Robot Framework

Could you tell me about how to get the variable type in Robot Framework. 你能告诉我如何在Robot Framework中获取变量类型吗?

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

Remark: Get the variable Type such as string, int 备注:获取变量Type,如string,int

get ${ABC} type = string 获取$ {ABC} type = string

get ${XYZ} type = int 获取$ {XYZ} type = int

This is what I use: 这是我使用的:

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

Note: it's good to have global string/int/float/list/dict/... examples for comparison than hard-coding the type values as they might differ depending on build. 注意:最好使用全局字符串/ int / float / list / dict / ...进行比较,而不是硬编码类型值,因为它们可能因构建而异。

你可以这样做: ${type_ABC} Evaluate type($ABC)

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM