Jmeter记录错误401 [英] Jmeter recording error 401

查看:792
本文介绍了Jmeter记录错误401的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我尝试用jmeter记录我的测试.因此,我将JMeter脚本记录器配置为使用端口8080.在浏览器中,将代理设置为localhost 8080. 在我的system.properties文件中,我设置了我公司的代理.

I try to record my test with jmeter. So I configure my JMeter Script Recorder to use the port 8080. In my browser, i set the proxy to localhost 8080. I my system.properties file, I set the proxy of my firm.

当我启动记录器并尝试进入我的站点时,出现以下错误"Connexion reset".当我尝试上Google时,出现以下错误内容编码错误".

When I start the recorder and try to go on my site, I've the following error "Connexion reset". When I try to go on google I've the following error "content encoding error".

你有什么主意吗?

推荐答案

HTTP错误401代表在代理后面使用JMeter 文章,您可以传递用户名和密码分别通过-u-a命令行参数.

HTTP Error 401 stands for Unauthorized so my expectation is that your corporate proxy required valid credentials. As per Using JMeter behind a proxy article you can pass username and password via -u and -a command-line arguments correspondingly.

-H [代理服务器主机名或IP地址]

-H [proxy server hostname or ip address]

-P [代理服务器端口]

-P [proxy server port]

-N [非代理主机](例如* .apache.org | localhost)

-N [nonproxy hosts] (e.g. *.apache.org|localhost)

-u [用于代理身份验证的用户名-如果需要的话]

-u [username for proxy authentication - if required]

-a [用于代理身份验证的密码-如果需要的话]

-a [password for proxy authentication - if required]

因此,您需要像这样启动JMeter:

So you need to start JMeter like:

jmeter -H your_corporate_proxy_host -P your_corporate_proxy_port -u username -a password 

替代选项使用的是

Alternative option is using JMeter Chrome Extension, in this case you won't need to worry about setting up proxies and SSL certificates.

这篇关于Jmeter记录错误401的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆