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

推荐订阅源

N
Netflix TechBlog - Medium
V
Vulnerabilities – Threatpost
Google Online Security Blog
Google Online Security Blog
Hugging Face - Blog
Hugging Face - Blog
L
LINUX DO - 热门话题
云风的 BLOG
云风的 BLOG
P
Proofpoint News Feed
D
Docker
C
Cyber Attacks, Cyber Crime and Cyber Security
MyScale Blog
MyScale Blog
P
Palo Alto Networks Blog
T
Tenable Blog
P
Privacy International News Feed
Google DeepMind News
Google DeepMind News
小众软件
小众软件
Cisco Talos Blog
Cisco Talos Blog
aimingoo的专栏
aimingoo的专栏
Cyber Security Advisories - MS-ISAC
Cyber Security Advisories - MS-ISAC
A
Arctic Wolf
C
Cybersecurity and Infrastructure Security Agency CISA
C
Cisco Blogs
T
Threat Research - Cisco Blogs
NISL@THU
NISL@THU
The Hacker News
The Hacker News
Project Zero
Project Zero
AWS News Blog
AWS News Blog
Simon Willison's Weblog
Simon Willison's Weblog
cs.CL updates on arXiv.org
cs.CL updates on arXiv.org
T
Threatpost
V
Visual Studio Blog
The GitHub Blog
The GitHub Blog
The Cloudflare Blog
Last Week in AI
Last Week in AI
Jina AI
Jina AI
Cyberwarzone
Cyberwarzone
The Register - Security
The Register - Security
C
CXSECURITY Database RSS Feed - CXSecurity.com
Vercel News
Vercel News
D
Darknet – Hacking Tools, Hacker News & Cyber Security
MongoDB | Blog
MongoDB | Blog
U
Unit 42
Scott Helme
Scott Helme
A
About on SuperTechFans
WordPress大学
WordPress大学
F
Fortinet All Blogs
大猫的无限游戏
大猫的无限游戏
G
GRAHAM CLULEY
Latest news
Latest news
让小产品的独立变现更简单 - ezindie.com
让小产品的独立变现更简单 - ezindie.com
S
Schneier on Security

博客园 - 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. 运行结果: