===========================windows环境运行脚本==============================
@echo off del /s /q C:\testplan\result\* rd /s /q C:\testplan\webreport mkdir C:\testplan\webreport call jmeter -n -t C:\Users\user1\Desktop\script\V12.jmx -R xxx.xxx.xxx.xxx:20098,xxx.xxx.xxx.xxx:20098,xxx.xxx.xxx.xxx:20098,xxx.xxx.xxx.xxx:20098 -l C:\testplan\result\result.jtl call jmeter -g C:\testplan\result\result.jtl -o C:\testplan\webreport pause
============================linux环境下运行脚本============================
#!/bin/bash #heider:20220216 echo -e "\033[34;40m 删除旧的测试报告...\033[0m" rm -rf ./../web_report/* rm -rf result rm -rf ./../report.zip sleep 1 mkdir result chmod 777 -R result echo -e "\033[34;40m 删除完成!!!...\033[0m" echo -e "\033[34;40m ...3...\033[0m" sleep 2 echo -e "\033[34;40m ...2...\033[0m" sleep 2 echo -e "\033[34;40m ...1...\033[0m" sleep 2 echo -e "\033[34;40m =========开始执行脚本==========\033[0m" jmeter -n -t ./V6.jmx -R?xxx.xxx.xxx.xxx:20099,xxx.xxx.xxx.xxx:20099 -l result/result.jtl jmeter -g ./result/result.jtl -o /usr/local/apache-jmeter-5.1.1/web_report while : do ? if [ -a /usr/local/apache-jmeter-5.1.1/web_report/index.html ]; then ? ?echo -e "\033[34;40m ========正在打包。。。。==========\033[0m" ? ?zip -r ./../report.zip ./../web_report ? ?break ?fi sleep 3 done echo -e "\033[34;40m ========脚本执行完成==========\033[0m" ?
|