jmeter export test results to excel

Recently, I wrote a tool to write test results into excel.

Export as shown below

The beanshell assert code is as follows

import com.wuhuhuan.util.ExcelJunitReport;
ExcelJunitReport ejt = new ExcelJunitReport();
//响应数据
String response_data = prev.getResponseDataAsString();
//请求头
String rth = RequestHeaders;
// 请求数据
String sll =SamplerData;
//title
String casetitle=prev.getThreadName(); ;
//用例名
String test="发送百度请求";
//初始条件
String initialCondition= "1.网络环境良好;"+"\n2.接口联调通过;"+"\n3.头信息添加:"+"\n"+rth;
//String OperationalSteps = "使用Jmeter播放专用脚本查看\n"+sll;
//操作步骤
String OperationalSteps = sll;
//期望结果
String ExpectedResults="这里是预期结果";
//实际结果
String ActualResults= "p";
//备注
String common= "这里是备注";  
//回归测试
String backtest="";
//备注
String common1= response_data;
//是否通过(如果为pass 会在实际结果中填充绿色,否则填充红色)
String ispass="pass";
//文件路径
String path="d:\\";
//导出文件名称(ps 只分装了xlsx 文件格式,如果写其他格式会报错)
String filename="baidu1.xlsx";
ejt.writeExcel(path,filename,"2.10.1预发布播放回归",casetitle,"MENHU-Playurl" ,"P1",test,initialCondition ,OperationalSteps ,ExpectedResults,ActualResults,common,backtest,common1,ispass);

Download address of jar package: https://download.csdn.net/download/QWERTY55555/12047506

Put the jar package in the root directory of jmeter \ lib \ ext and restart jmeter

jmx download address: https://download.csdn.net/download/QWERTY55555/12047515

 

Published 42 original articles · praised 11 · 20,000+ views

Guess you like

Origin blog.csdn.net/QWERTY55555/article/details/103669481