Get Type in Robot Framework

Bell Aimsaard picture Bell Aimsaard · Mar 6, 2017 · Viewed 12.7k times · Source

Could you tell me about how to get the variable type in Robot Framework.

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

Remark: Get the variable Type such as string, int

get ${ABC} type = string

get ${XYZ} type = int

Answer

Lubos Jerabek picture Lubos Jerabek · Mar 13, 2017

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.