晨风

RF内置库函数学习(一)

Builtin库(固定库)

evaluate(求值)求表达式的值并返回结果。

Arguments:

[ expression | modules=None | namespace=None ]

Evaluates the given expression in Python and returns the results.

expression is evaluated in Python as explained in `Evaluating expressions`.

 

modules argument can be used to specify a comma separated list of Python modules to be imported and added to the evaluation namespace.

Modules 参数用来指定是从python的哪个模块导入,并增加到namespace。即在调用python的函数时,在此指明函数所在的模块。

释义:返回一个随机数。调用了random模块,sys模块。此处modules可以不写。

      Maxint sys中的最大整数值。即在0和最大整数值间随机一个数。

namespace argument can be used to pass a custom evaluation namespace as a dictionary. Possible modules are added to this namespace. This is a new feature in Robot Framework 2.8.4.

namespace 用来指定自定义的词典。即指明表达式计算的时候,变量值从那个自定义的区间去取。Namespace单词必须写。

 

释义:创建一个${ns}的词典,调用词典中的x,y并将计算结果给result。

 

posted on 2017-04-06 09:42  morwind  阅读(406)  评论(0编辑  收藏  举报

导航