Jmeter 经常使用函数(19)- 详解 __BeanShell

若是你想查看更多 Jmeter 经常使用函数能够在这篇文章找找哦html

https://www.cnblogs.com/poloyy/p/13291704.htmdom

 

做用

执行 BeanShell 脚本,并返回结果函数

 

语法格式

${__BeanShell(123*456,name)}

 

参数讲解

字段 含义 是否必传
BeanShell BeanShell 脚本 yes
Variable Name 存储脚本返回结果的变量名 no

 

小栗子

设置 Jmeter 变量

${__BeanShell(vars.put("yytest"\,"${__Random(1000,5555)}"),)}

 

读取 Jmeter 变量

${__BeanShell(vars.get("yytest"),)}

 

设置 Jmeter 属性

${__BeanShell(props.put("yytest"\,"1234"),)}

 

读取 Jmeter 属性

${__BeanShell(props.get("yytest"),)}

 

重点

BeanShell 能写啥,这里也能写啥,不过要记住这是简化版的 BeanShell,是为了方便而已,不是彻底可代替哦spa

相关文章
相关标签/搜索