惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

T
Tailwind CSS Blog
大猫的无限游戏
大猫的无限游戏
L
LINUX DO - 热门话题
让小产品的独立变现更简单 - ezindie.com
让小产品的独立变现更简单 - ezindie.com
雷峰网
雷峰网
aimingoo的专栏
aimingoo的专栏
博客园_首页
MongoDB | Blog
MongoDB | Blog
V
V2EX
GbyAI
GbyAI
量子位
Microsoft Azure Blog
Microsoft Azure Blog
有赞技术团队
有赞技术团队
G
Google Developers Blog
云风的 BLOG
云风的 BLOG
B
Blog
Microsoft Security Blog
Microsoft Security Blog
S
SegmentFault 最新的问题
O
OpenAI News
N
News and Events Feed by Topic
博客园 - Franky
爱范儿
爱范儿
Forbes - Security
Forbes - Security
freeCodeCamp Programming Tutorials: Python, JavaScript, Git & More
V2EX - 技术
V2EX - 技术
Application and Cybersecurity Blog
Application and Cybersecurity Blog
N
News and Events Feed by Topic
N
News | PayPal Newsroom
Schneier on Security
Schneier on Security
Cloudbric
Cloudbric
Security Archives - TechRepublic
Security Archives - TechRepublic
cs.AI updates on arXiv.org
cs.AI updates on arXiv.org
Recent Commits to openclaw:main
Recent Commits to openclaw:main
人人都是产品经理
人人都是产品经理
P
Privacy International News Feed
Cyber Security Advisories - MS-ISAC
Cyber Security Advisories - MS-ISAC
B
Blog RSS Feed
阮一峰的网络日志
阮一峰的网络日志
D
DataBreaches.Net
Last Week in AI
Last Week in AI
罗磊的独立博客
Spread Privacy
Spread Privacy
Recent Announcements
Recent Announcements
The Cloudflare Blog
Google DeepMind News
Google DeepMind News
AWS News Blog
AWS News Blog
The Register - Security
The Register - Security
Y
Y Combinator Blog
J
Java Code Geeks
I
Intezer

博客园 - LCX测试小姐姐

apifox 批量导入和运行项目 Jmeter 与 阿里云 性能测试PTS 作为python自动化测试 推送阿里的通义灵码,大大提高效率 redis测试点 性能测试过程中优化-3: 性能测试过程中优化-2: Elasticsearch 分词功能 Elasticsearch 常用功能 Cookie、session、token、sign鉴权 性能测试过程中优化-1: RocketMQ jmeter性能测试实例3解析--性能瓶颈分析过程 pip freeze >requirements.txt python 生成 .exe文件、调用.exe文件 jmeter性能测试实例2解析--linux环境 memcache常用命令 memcache与redis关系与区别 MySql常见性能查询、调优语句和慢sql 性能测试中TPS值上不去分析原因及满足性能指标 mysql之测试工程师必会基础知识
jmeter 把响应结果数据写入指定txt文件
LCX测试小姐姐 · 2024-03-19 · via 博客园 - LCX测试小姐姐

  需要把登陆接口返回的token提取出来,保存到一个文件里给其它接口用。登陆接口响应如下

      

  1. 在登陆接口取样器下添加 "JSON提取器",提取token 

  2. 在登陆接口取样器下添加"BeanShell 后置处理程序"

     代码如下:

    //指定需要定稿到哪个文件,格式:TXT,CSV
    FileWriter file = new FileWriter("D:\\Token.txt",true);
    //创建一个字符缓存输出流
    BufferedWriter out = new BufferedWriter(file);
    //写入文件内容
    out.write(vars.get("token")+"\n");
    //关闭数据流
    out.close();
    //关闭文件
    file.close();
  3. 运行结果: