Setup JMeter proxy to record activities on a local web application - proxy

I'm new to JMeter and I want to load test a local web application recording test case with JMeter proxy.
I've first followed instruction here http://jmeter.apache.org/usermanual/jmeter_proxy_step_by_step.pdf and all worked fine.
Than:
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
I obtain:
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.
What's going wrong? I missed some basic configuration? I'm using JMeter Proxy in the wrong manner?

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.

Firefox by default does not allow localhost or 127.0.0.1 to be proxied.
You have to modify a setting in about:config
change network.proxy.allow_hijacking_localhost to true

Go To Browser LAN Settings
Make sure "Bypass proxy server for local addresses" is unchecked so that request will hit JMeter proxy server.

Simple steps to be followed for recording in jmeter:
open ur jmeter (contains testplan and workbench in default)
add a threadgroup
add “http request defaults” whic is under config( change the server name i.ethe site u need to record)
add “http proxy server (workbench-rightclick-non testing elements-http proxy server)change the default port 8080 to
someother(eg 9090)
start the proxy server
change the browser settings to manual setup with 9090 port and localhost
http://brittoc.wordpress.com/2011/03/28/jmeter-recording-steps/

I would suggest using Apache's own tutorial on this, it is located here...
JMeter Proxy Tutorial
I see that you say you have followed it, but it may have changed since you used it as some of your steps do not match the current tutorial. Perhaps your version had a bug or you missed a step, because I just double checked it 5 minutes ago and it worked for me and I don't see some of the steps you are talking about above.
I realize you have specific questions about specific errors that you are concerned with, but based on your current unfamiliarity with the process in general, I would abandon the curl part, and just do the basic proxy recording as Apache describes it to get a better general understanding, then take it from there.
The only caveat I would add to their tutorial, they have you create filters to only record certain types of actions, I actually leave those out so it will record all actions, then I just clean it up later.
This way you don't miss anything that could potentially be causing lag because that type of resource was filtered out.
* Now, one thing in your original question, you can try if you have no intention of doing the tutorial, try the browser, not curl, and setup your browser to use a proxy, and make sure the port matches the one you specify in jmeter on the proxy node.

Its very simple to configure. Please have a look to the attached screenshot.

Related

How can I record JMeter scripts behind company's proxy auto config (PAC) file?

The Internet Options settings are managed by my company's system administrator.
The Proxy is set to use automatic configuration script (http://proxypac.abcd.com/proxyrouting). I cannot disable this.
I cannot change the proxy to localhost. The above PAC script will override no matter what I try to change.
The IT security does not allow me to install Chrome Blazemeter plugin, or install Badboy, or use Fiddler, or be able to manually change the proxy.
The company's proxy host is proxy.abcd.com and port is 8080, but I don't know how this info will help if the browser is reading the PAC file.
Is there any option for me to record JMeter scripts in the above scenario?
Is there any way for me to create GUI scripts with plenty of data and dynamic values coming back from the server without recording (if recording is not an option in my case)?
You can use a browser which doesn't use operating system proxy settings, a good example is Mozilla Firefox. You need to configure Firefox to use JMeter as the proxy
Once done you can configure JMeter to use your company proxy server by putting the following lines to system.properties file:
http.proxyHost=proxy.abcd.com
https.proxyHost=proxy.abcd.com
http.proxyPort=8080
https.proxyPort=8080
These PAC files don't do any magic, they're normal JavaScript files which are being interpreted by browsers to determine which proxy should be used for which URL. For certain URLs you might not even need to use the proxy. So I would recommend checking whether you really need the proxy for accessing the application you're trying to record, it might be the case you don't need this step #2

Can't able to record jmeter with proxy server

I can't able to record jmeter using with proxy server.
I tried proxy settings in RUN command jmeter.bat -H 192.168.61.202 -P 8080.
Jmeter is recording with the browser actions, but not connecting the internet.
Showing error page on browser.
See the screenshot- Error shown in browser
are you able to record it using normal browser mode? If yes you should check for the firewall and add the specific port numbers to exclusions as some time back I faced the same issue, after i added the port number to excluded in Inbound and Outbound rules and disabling the antivirus setup on my machine made it work

jMeter on VM with no internet not finishing test

My company is trying to use JMeter in a VM (Windows Server 2003 :( )with no internet connectivity to hit another VM with a server set up and code running on IIS. I set up the ip address in my hosts file, let's call it server.dev for now. Our goal is to hit server.dev/doSomething When we go into IE and hit server.dev we get a response.
We use a keystore with JMeter and it says that it creates it correctly. In JMeter we have an HTTP Request where we hit the server.dev, and the path is set to /doSomething. JMeter then starts, and the log has no errors, but once it says "Creating the HTTPS Trusall Scheme" it hangs. When I put debug flags on it shows that it created the SOAP Request correctly and seems to send it out. The Headers should all be correct. It hangs here for about 1 minute and then shuts down with error with saying something along the lines of "Could not get response from server".
Does anyone have any ideas on where to go from here? I tried to debug for hours, but got nowhere. I can't seem to load up Fiddler to see the network traffic either, since there is no localhost set up.
Most likely that IE uses proxy and JMeter does not. Try other browser, i.e. Firefox (it doesn't respect system proxy settings if you won't import anything during installation) and if Firefox won't be able to establish the connection - my assumption is correct and you're sitting behind the proxy server.
There is a way to "tell" JMeter to use a proxy server, it is controllable via command-line arguments, to wit:
-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]
See Using JMeter behind a proxy guide for details and Full list of command-line options for the full list.
You can also configure proxy settings in system.properties file (which lives under /bin folder of your JMeter installation), add the following lines to it:
http.proxyHost=your.proxy.ip.address.or.host.name
http.proxyPort=your.proxy.port
https.proxyHost=your.proxy.ip.address.or.host.name
https.proxyPort=your.proxy.port
And after JMeter restart everything should work as expected.
See Apache JMeter Properties Customization Guide for more information on JMeter properties and ways of setting and overriding them

Unable to record script using Jmeter

I am new to Jmeter and unable to record script using Jmeter. Eventhough I have followed the instruction provided by Apache.Jmeter.org. Pls update me with the few esay steps to move on.
Thanks,
Karthik.
If you are recording the script you can follow sequence,
Jmeter becomes your proxy and records everything between your real proxy and you so make proxy as localhost and port no as 8080 for http
if you are trying record a script for application running on proxy/local machine then above setup is enough
if you want to record script for a application on WAN then start jmeter like,
Jmeter - H "proxy which you are using" -P "port no" <-u "username" -a "password">
by default test plan is present when you start jmeter
add threadgroup and proxy recorder in script
start recording
If you have difficulties in setting up HTTP(S) Test Script Recorder (despite the fact it's perfectly documented in JMeter Proxy Step by Step guide you could try using Google Chrome JMeter plugin which allows JMeter scripts recording right from browser without needing to worry about proxies, browser extra configuration, SSL certificates, etc.
The most common error for using JMeter proxy is Do not use proxy for localhost / 127.0.0.1. If you have this or similar option in your browser make sure that it's disabled
I'm sorry, but the links are in spanish
http://josepablosarco.wordpress.com/2009/02/03/performance-testing-con-jmeter-paso-por-paso-para-grabar-escenarios/
http://carloszuluaga.wikidot.com/pruebascarga:grabar-script-web

Jmeter's proxy server does not record

New to JMeter. I have downloaded and configured proxy server as the step by step guide from JMeter website. Got right log message such as "protocol 8080 has been created" and "Proxy is up running" etc. But it just did not record localhost:8080 with Tomcat. Change to Neoload to record localhost:8080 and everything works fine but JMeter just does not record anything. There is no errors in the log or within the screen.
Did you start the proxy ?
Try stopping it to see if you get an error in browser.
Are you sure neoload is not already listening to this same port and jmeter could not start on this same one.
Finally you could try using your ip in browser address.
I don't know what mistake have you made. This is what you can do from scratch:
Create empty plan
Add HTTP Proxy Server to WorkBench
In its configuration set port to free one at your computer (maybe 8080 is busy). Click Start
Set browser proxy to localhost, choose the same port as in JMeter's proxy
Browse to any url
--> Samplers should appear in JMeter
You may also like to change Target Controller so samplers will appear in more appropriate place

Resources