JMeter 开启录制过程报错

1.今天在利用JMeter的代理服务器录制压测用例的时候,遇到了如下的问题:
运行环境:WIN10, jdk1.8.0_66, JMeter 2.13,
>.在TestPlan下新建ThreadGroup;
>.在WorkBench新建 Non-Test Element->HTTP(S) Test Script Recorder.
>.设置好配置:
>.点击‘Start’ 开始录制,此时报错:
JmeterError
2.Rootcause:
JMeter 2.10 uses a new method for recording HTTPS requests when running under Java 7.
There have been some reports of problems starting the recorder, with errors such as the following:
“ERROR – jmeter.protocol.http.proxy.ProxyControl: Could not initialise key store java.io.IOException: Cannot run program “keytool” (in directory “C:\apache-jmeter-2.10\bin”): CreateProcess error=2, The system cannot find the file specified”
This means that the “keytool” application could not be found on the PATH. Please ensure that the PATH includes the bin directory for the appropriate Java installation.
If this was not correctly set when Java was installed, it may be necessary to update the script that starts JMeter.
For example add the following to jmeter.bat (Windows)
3.解决方案:
需要在jmeter.bat 里配置环境变量:
# set JAVA_HOME= SET JAVA_HOME=C:\Program Files\Java\jdk1.8.0_66
SET PATH=%PATH%;%JAVA_HOME%\bin
4.重启JMeter,开启我的压测之旅吧~~.

参考文章:https://wiki.apache.org/jmeter/TestRecording210
http://www.51testing.com/html/43/489243-857877.html

Leave a Comment

This site uses Akismet to reduce spam. Learn how your comment data is processed.