小编Bak*_*Bug的帖子

如何检查Robot Framework中的变量类型?

我正在使用 Robot Framework 来测试一个返回 int 的系统,该 int 表示系统在测试时遇到的错误数。但是,如果系统变得无响应,则返回将是 NoneType 并且我收到此错误: 'None' cannot be converted to an integer: TypeError: int() argument must be a string or a number, not 'NoneType'

我无法使用该Should Be True关键字,因为传递的响应将为 0。

有什么方法可以测试机器人中变量的类型吗?我的目标是做这样的事情:

Should Not Be NoneType    ${error_count}    msg=System is not responding after test.
Should Be Equal As Integers    ${error_count}    ${0}    msg=System generated ${error_count} errors during test.
Run Code Online (Sandbox Code Playgroud)

robotframework

3
推荐指数
1
解决办法
9111
查看次数

标签 统计

robotframework ×1