JMeter的下载以及安装使用

下载 

https://jmeter.apache.org/download_jmeter.cgihtml

 

安装

无须安装,解压以后便可使用。java

解压到C:\Program Files\apache-jmeter-5.1目录下(没法直接解压,先在D盘解压,而后复制到C盘里面)。apache

运行以后,一闪而过,没有出现UI。浏览器

须要注意的是:启动bat文件最好用管理员权限,不然个人使用路径是系统盘,会出现log文件不能写的问题cookie

问题排查

注释掉jmeter.bat文件中的第一行,rem @echo off,而后运行以下命令,能够看到错误:工具

C:\Program Files\apache-jmeter-5.1\bin [master +0 ~1 -0 !]> .\jmeter.bat >>launch.log
java.lang.Throwable: Could not access C:\Program Files\apache-jmeter-5.1\lib
at org.apache.jmeter.NewDriver.<clinit>(NewDriver.java:105)
java.lang.Throwable: Could not access C:\Program Files\apache-jmeter-5.1\lib\ext
at org.apache.jmeter.NewDriver.<clinit>(NewDriver.java:105)
java.lang.Throwable: Could not access C:\Program Files\apache-jmeter-5.1\lib\junit
at org.apache.jmeter.NewDriver.<clinit>(NewDriver.java:105)
java.lang.ClassNotFoundException: org.apache.jmeter.JMeter
at java.net.URLClassLoader.findClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at org.apache.jmeter.NewDriver.main(NewDriver.java:250)
JMeter home directory was detected as: C:\Program Files\apache-jmeter-5.1post

 解决:发现是lib文件夹没有复制成功致使的,以前复制文件夹的时候,提示lib被占用。因此没有复制成功。网站

 

PluginsManager

https://jmeter-plugins.org/wiki/PluginsManager/ ui

安装

https://jmeter-plugins.org/install/Install/this

The easiest way to get the plugins is to install Plugins Manager. Then you'll be able to install any other plugins just by clicking a checkbox.

Download plugins-manager.jar and put it into lib/ext directory, then restart JMeter.  

 proxy

Plugins Manager respects JMeter's proxy settings. However, to avoid editing the properties files, we recommend to launch JMeter with additional parameters to pass it the proxy settings:

JVM_ARGS="-Dhttps.proxyHost=myproxy.com -Dhttps.proxyPort=8080" jmeter\bin\jmeter.bat

If you need proxy username/password, specify them with two additional properties http.proxyUser and http.proxyPasslike this:

JVM_ARGS="-Dhttps.proxyHost=myproxy.com -Dhttps.proxyPort=8080 -Dhttp.proxyUser=john -Dhttp.proxyPass=***" jmeter\bin\jmeter.bat

在system.properties文件中配置代理

So if you don't wish to set both http and https proxies, you can define the relevant properties in system.properties instead of using the command-line parameters.

https://stackoverflow.com/questions/52084212/how-to-manage-proxy-in-jmeter

You can configure JMeter to use proxy in 2 ways:

  1. Command-line

    jmeter -H your_proxy_host -P your_proxy_port
  2. Using system.properties (the file lives under "bin" folder of your JMeter installation, add the next lines to it:

    http.proxyHost=your_proxy_host
    http.proxyPort=your_proxy_port
    https.proxyHost=your_proxy_host
    https.proxyPort=your_proxy_port

    JMeter restart will be required to pick the properties up. 

 须要注意的是,http.proxyHost=http://    这里须要加http://

unable to find valid certification path to requested target

https://www.cnblogs.com/chucklu/p/10445580.html

 

在jmeter.properties配置

# CookieManager behaviour - should Cookies be stored as variables?
# Default is false
CookieManager.save.cookies=true

 

407错误,代理须要受权

给代理配置上帐户,这里的帐号和密码。密码若是有特殊字符,须要先进行一次urlencode【密码中的@会被转换成%40】

 http://帐号:密码@域名(ip):端口号

 

 总结

  • 使用的proxy必须加上http://的前缀
  • 使用的proxy必须配置帐户和密码

         建议在bin\ system.properties文件末尾添加以下两行

          http.proxyHost=http://域帐号:密码(url encode以后的) @proxy:port

         http.proxyPort=8080

      参考https://blog.csdn.net/c5113620/article/details/80384660

  • 将证书导入Java的证书验证系统(Java的证书验证系统是独立于操做系统和浏览器的,而是使用JRE中证书库,全部必须把代理工具的证书加入到JRE的证书库中。)

       https://blog.csdn.net/write_down/article/details/79114573

 

 

 

https://www.blazemeter.com/blog/how-to-configure-jmeter-logging

相关文章
相关标签/搜索