Jmeter:打印beanshell结果的地方
Jmeter: Where beanshell result is printed
我从我的 Web 服务得到了这个 JSON 响应:
[
{
"type": "022",
"sendDate": "2020-11-09 12:43:07",
"message": "test1",
"id": 8035,
},
{
"notificationType": "023",
"sendDate": "2020-11-09 11:40:02",
"message": "test2 ",
"id": 8034,
},...
]
现在通过 JMeter 中的 Beanshell,我想先将 id
传递到新请求中,所以在 JSR223 PostProcessor 中,我写了一个简单的打印,如下所示:
import com.eclipsesource.json.*;
String jsonString = prev.getResponseDataAsString();
print("value "+ jsonString);
但是当我 运行 我的休息测试时,我得到了这个:
我的打印值在哪里?我希望在 JMeter 日志查看器上看到我的结果
System.out
将打印到控制台,如果你想打印到 JMeter 的日志使用 log 变量
log.info("value=" + jsonString);
log - (Logger) - can be used to write to the log file
(日志查看器显示jmeter.log)
我从我的 Web 服务得到了这个 JSON 响应:
[
{
"type": "022",
"sendDate": "2020-11-09 12:43:07",
"message": "test1",
"id": 8035,
},
{
"notificationType": "023",
"sendDate": "2020-11-09 11:40:02",
"message": "test2 ",
"id": 8034,
},...
]
现在通过 JMeter 中的 Beanshell,我想先将 id
传递到新请求中,所以在 JSR223 PostProcessor 中,我写了一个简单的打印,如下所示:
import com.eclipsesource.json.*;
String jsonString = prev.getResponseDataAsString();
print("value "+ jsonString);
但是当我 运行 我的休息测试时,我得到了这个:
我的打印值在哪里?我希望在 JMeter 日志查看器上看到我的结果
System.out
将打印到控制台,如果你想打印到 JMeter 的日志使用 log 变量
log.info("value=" + jsonString);
log - (Logger) - can be used to write to the log file
(日志查看器显示jmeter.log)