1
votes

I want to record a scenario for the a particular site using Jmeter. As per the standard procedure I have changed the proxy settings to localhost:8080.

When I start recording, the page of the particular site does not load.

Note: For normal browsing we use a particular proxy. Please assist on this asap.

Following is the error that I get on the browser.

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)

Regards, Kiran

1
If you are using any proxy server - Check whether you have not bypassed localhost in proxy settings. In latest version of Jmeter(2.11) you can use test script recorder template to create test plan .Nithin CV

1 Answers

0
votes

you are testing an application behind a proxy server. so, you have to specify this when running JMeter. To solve your problem you must follow those steps:

  1. Open cmd command ang go under bin folder
  2. type jmeter.bat -H [proxyserver hostname or ip address] -P [proxyserver port]

Example : jmeter.bat -H my.proxy.server -P 8000

For More details: If you are testing from behind a firewall/proxy server, you may need to provide JMeter with the firewall/proxy server hostname and port number. To do so, run the jmeter[.bat] file from a command line with the following parameters:

-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]