Jenkins 对项目持续集成的配置之二 API接口自动化 Ant+Jmeter

先介绍一下Ant+Jmeter

今天琢磨了一下,可以不用ant吗?

直接Jmeter执行jmx工程,然后发送测试结果到指定邮箱

从理论上讲感觉是可行的,

毕竟windows下进入jmeter的bin目录后,用下面N0-GUI屡试不爽啊

jmeter -n -t /home/jasqia/apache-jmeter4.0/jmxfile/ikea/*.jmx -l /home/jasqia/apache-jmeter4.0/jmxfile/ikea -e -o /home/jasqia/apache-jmeter4.0/jmxfile/ikea02/

为什么不能在Linux上试一下呢

Step1: 设置了Linux上的环境变量,jdk8以上,因为我用的Jmter4.0,必须高版本的JDK

[root@ntgsrv11 etc]# java -version
java version "1.8.0_131"
Java(TM) SE Runtime Environment (build 1.8.0_131-b11)
Java HotSpot(TM) 64-Bit Server VM (build 25.131-b11, mixed mode)

Step2: 我遇到的各种问题,目前正在填坑中

[root@ntgsrv11 bin]# sudo ./jmeter -n -t /home/jasqia/apache-jmeter4.0/jmxfile/ikea/*.jmx -l /home/jasqia/apache-jmeter4.0/jmxfile/ikea  -e -o /home/jasqia/apache-jmeter4.0/jmxfile/ikea02/
sudo: ./jmeter: command not found
[root@ntgsrv11 bin]# sudo ./jmeter.sh -n -t /home/jasqia/apache-jmeter4.0/jmxfile/ikea/*.jmx -l /home/jasqia/apache-jmeter4.0/jmxfile/ikea  -e -o /home/jasqia/apache-jmeter4.0/jmxfile/ikea02/
Neither the JAVA_HOME nor the JRE_HOME environment variable is defined
At least one of these environment variable is needed to run this program

如果我活过来,我会补上我的埋坑神药

相关推荐