当前位置: 代码迷 >> 综合 >> RobotFrameWork(四)变量运算与Evaluate
  详细解决方案

RobotFrameWork(四)变量运算与Evaluate

热度:20   发布时间:2023-12-22 11:13:21.0

一、特殊变量运算:

这里写图片描述

执行结果:

Starting test: Robot Demo.Demo.test
20161115 10:14:49.949 : INFO : =82016111510:14:49.950:INFO: {布尔类型true运算} = 4
20161115 10:14:49.951 : INFO : false=02016111510:14:49.952:INFO: {space运算} =
Ending test: Robot Demo.Demo.test

二、Evaluate使用
函数释义:Evaluate是执行python表达式,并返回执行结果

示例1:

这里写图片描述

执行结果:
Starting test: Robot Demo.Demo.test4-2
20161115 10:32:08.674 : INFO : var1=42016111510:32:08.675:INFO: {var2} = 8
20161115 10:32:08.677 : INFO : var1+var2=122016111510:32:08.678:INFO: {var1-var2} = -4
20161115 10:32:08.679 : INFO : var1?var2=322016111510:32:08.680:INFO: {var1/var2} = 0
Ending test: Robot Demo.Demo.test4-2

示例2:
这里写图片描述

执行结果:
Starting test: Robot Demo.Demo.Python表达式运算
20161115 11:16:42.100 : INFO : result=3.142016111511:16:42.101:INFO: {status} = True
20161115 11:16:42.102 : INFO : =32016111511:16:42.103:INFO: {向上取整} = 4.0
Ending test: Robot Demo.Demo.Python表达式运算

  相关解决方案