1、下载Jython jar包:https://www.jython.org/download

 

2、把下载的Jython 的jar包放到 jmeter的lib文件夹。重启jmeter。

3、线程组中添加 JSR223 Sampler。

 

 

 

 

log.info("*****开始*******************************");
log.info("----ctx---------------------------------");
pre=ctx.getPreviousResult();
log.info("Name"+pre)
result=prev.isSuccessful();
log.info('状态'+result)
log.info("Request Content: "+pre.getSamplerData());
log.info("Response: "+pre.getResponseDataAsString());
log.info("----sampler---------------------------------");
log.info("name:"+sampler.getName());
log.info("描述: "+sampler.getComment());
log.info("ThreadContext: "+sampler.getThreadContext());
log.info("线程组: "+sampler.getThreadName());
log.info("MultipartPost: "+sampler.getUseMultipartForPost());
log.info("*****结束*******************************");

4、设置JSR223 Sampler,选择Python语言。

 

posted on 2022-04-28 17:40  筑梦小小屋  阅读(55)  评论(0编辑  收藏  举报