本文介绍了设置JMeter代理以记录本地Web应用程序上的活动的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我是JMeter的新手,我想用JMeter代理进行负载测试并记录测试用例的本地Web应用程序.

I'm new to JMeter and I want to load test a local web application recording test case with JMeter proxy.

我首先在这里遵循了说明 http://jmeter.apache.org/usermanual/jmeter_proxy_step_by_step .pdf ,并且一切正常.

I've first followed instruction here http://jmeter.apache.org/usermanual/jmeter_proxy_step_by_step.pdf and all worked fine.

比:

  • 我启动了我的Web应用程序,例如http://localhost:8080/my-application
  • 在端口8081上设置JMeter Web代理
  • 向线程组添加了HTTP请求默认值
  • Addea录音控制器
  • 调用了curl -X GET http://localhost:8081/my-application/index.html
  • I launched my web application, say http://localhost:8080/my-application
  • Setup JMeter web proxy on port 8081
  • Added an HTTP Request Default to a Thread Group
  • Addea a Recording Controller
  • Invoked curl -X GET http://localhost:8081/my-application/index.html

我获得:

  • 记录请求,但参数错误,例如 https 代替http
  • 我没有获得请求的带有curl的页面,但例外:org.apache.http.client.ClientProtocolException: URI does not specify a valid host name: https:///my-application/index.html/my-application/index.html
  • 我在Http Request Default中指定的参数似乎被忽略了?我将配置元素放在HTTP代理服务器下,并尝试了许多设置.
  • Request are recorded but with wrong parameters, eg. https instead of http
  • I don't get the requested page with curl, but the exception: org.apache.http.client.ClientProtocolException: URI does not specify a valid host name: https:///my-application/index.html/my-application/index.html
  • The parameters I've specified in Http Request Default seems to be ingnored? I placed configuration element under HTTP Proxy Server, and tried many settings.

出了什么问题?我错过了一些基本配置吗?我以错误的方式使用JMeter代理吗?

What's going wrong? I missed some basic configuration? I'm using JMeter Proxy in the wrong manner?

推荐答案

Firefox的默认设置将绕过代理服务器的"localhost,127.0.0.1",因此您的JMeter仍然无法对其进行记录.您必须通过删除"localhost,127.0.0.1"来清空"No Proxy for"字段.希望这会有所帮助.

Firefox default setting will bypass "localhost, 127.0.0.1" from proxy so your JMeter still not able to record it. You have to empty the "No Proxy for" field, by removing the "localhost, 127.0.0.1". Hope this will help.

这篇关于设置JMeter代理以记录本地Web应用程序上的活动的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

10-23 00:57