Jmeter设置变量与引用变量(三)

在这里插入图片描述
例如在获取 access_token 的时候

需要用到请求:https://qyapi.weixin.qq.com/cgi-bin/gettoken?corpid=ID&corpsecret=SECRET

https://qyapi.weixin.qq.com/cgi-bin/gettoken?corpid=wwec301234a74f65df&corpsecret=2te1602SPutlA24XxSKlerzEUukxeGWVfoENi3e_S44

这里 ID, SECRET 是变量 当我们想要修改他们时比较麻烦;

更简单的方法是 设置变量,再去引用它们
在这里插入图片描述

在TestPlan添加变量

https://qyapi.weixin.qq.com/cgi-bin/gettoken?corpid=${
    
    ID}&corpsecret=${
    
    SECRET}

把相应的改为&{} 即可
在这里插入图片描述

Guess you like

Origin blog.csdn.net/weixin_45556441/article/details/121263686