无法在Jmeter中录制

时间:2014-06-11 06:53:48

标签: jmeter load-testing performance-testing blazemeter

我想使用Jmeter记录特定网站的场景。根据标准程序,我已将代理设置更改为localhost:8080。

当我开始录制时,不会加载特定网站的页面。

注意: 对于正常浏览,我们使用特定代理。请尽快协助。

以下是我在浏览器上遇到的错误。

java.net.ConnectException: Connection timed out: connect at 
java.net.PlainSocketImpl.socketConnect(Native Method) at 
java.net.PlainSocketImpl.doConnect(Unknown Source) at 
java.net.PlainSocketImpl.connectToAddress(Unknown Source) at 
java.net.PlainSocketImpl.connect(Unknown Source) at java.net.Socket.connect(Unknown Source)
 at java.net.Socket.connect(Unknown Source) at sun.net.NetworkClient.doConnect(Unknown Source) at 
sun.net.www.http.HttpClient.openServer(Unknown Source) at 
sun.net.www.http.HttpClient.openServer(Unknown Source) at sun.net.www.http.HttpClient.
(Unknown Source) at sun.net.www.http.HttpClient.New(Unknown Source) at 
sun.net.www.http.HttpClient.New(Unknown Source) at 
sun.net.www.protocol.http.HttpURLConnection.getNewHttpClient(Unknown Source) at 
sun.net.www.protocol.http.HttpURLConnection.plainConnect(Unknown Source) at 
sun.net.www.protocol.http.HttpURLConnection.connect(Unknown Source) at 
org.apache.jmeter.protocol.http.sampler.HTTPJavaImpl.sample(HTTPJavaImpl.java:485) at 
org.apache.jmeter.protocol.http.sampler.HTTPSamplerProxy.sample(HTTPSamplerProxy.java:62) at 
org.apache.jmeter.protocol.http.sampler.HTTPSamplerBase.sample(HTTPSamplerBase.java:1060)
 at org.apache.jmeter.protocol.http.proxy.Proxy.run(Proxy.java:238)

此致 基兰

1 个答案:

答案 0 :(得分:0)

您正在测试代理服务器后面的应用程序。所以,你必须在运行JMeter时指定它。要解决您的问题,您必须遵循以下步骤:

  1. 打开cmd命令ang进入bin文件夹
  2. 输入jmeter.bat -H [proxyserver hostname or ip address] -P [proxyserver port]
  3. 示例:jmeter.bat -H my.proxy.server -P 8000

    更多详情: 如果从防火墙/代理服务器后面进行测试,则可能需要向JMeter提供防火墙/代理服务器主机名和端口号。为此,请使用以下参数从命令行运行jmeter [.bat]文件:

    -H [proxy server hostname or ip address] 
    -P [proxy server port] 
    -N [nonproxy hosts] (e.g. *.apache.org|localhost) 
    -u [username for proxy authentication - if required] 
    -a [password for proxy authentication - if required]