获取当前脚本路径
${__BeanShell(import org.apache.jmeter.services.FileServer;FileServer.getFileServer().getBaseDir();)}
获取数据的截取的第一个字符
${__BeanShell("${message}".substring(0\,1),)}
${__counter(TRUE,)}
: 获取请求数
TRUE
表示当前的请求数
FALSE
表示全局请求数
${__threadNum}
:获取线程数

全局可以引用
${count}
计数
${__machineName()}
:获取本机名称
${__machineIP()}
:获取本机IP
${__javaScript(new Date(),MYDATE)}

${__Random(1,4,)}
:随机数
${__RandomString(3,qwertyuio,)}
:随机字符

${__property(user.dir,,)}\Desktop\data.txt
结果:
C:\Users\Administrator\Desktop\data.txt
${__P(user.dir,)}
和${__property(user.dir,,)}
功能类似
查看属性名路径:Test Plan右击>添加>非测试原件>Property Display

网友评论