如果你想查看更多 Jmeter 常用函數可以在這篇文章找找哦
https://www.cnblogs.com/poloyy/p/13291704.htm
作用
執行 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,是為了方便而已,不是完全可代替哦