jMeter on VM with no internet not finishing test - jmeter

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

Related

Jmeter Recording of scripts behind Proxy

I need to perform JMETER TEST and Record a WEB Login Page, my company is behind the proxy. If I change the proxy and port of the Firefox to 8080, My Application doesn't launch.
If I don't change the proxy in Firefox, Then the recorder doesn't record the script.
I tried with IE, Where due to corporate policy, I cant change the policy and it is disabled.
How I get out of this situation?
You need to keep Firefox proxy settings to point to JMeter's HTTP(S) Test Script Recorder, i.e. server name should be localhost, port should be 8888
In its turn JMeter needs to be configured to use your corporate proxy, it can be done in 2 ways:
Via command-line parameters, like:
jmeter -H your_corporate_proxy_host -P your_corporate_proxy_port -n -t ...
this way the change will be applied only once
If you want the changes to be permanent you can add the following lines to system.properties file (located in the "bin" folder of your JMeter installation)
http.proxyHost=your_corporate_proxy_host
http.proxyPort=your_corporate_proxy_port
https.proxyHost=your_corporate_proxy_host
https.proxyPort=your_corporate_proxy_port
References:
Using JMeter behind a proxy
Configuring JMeter
Apache JMeter Properties Customization Guide

JMeter does not record any client server activity

I am trying to record any client-server activity in JMeter as a start for learning. I am doing this from a company network and hence have to go through proxy. Below are the steps I took for recording.
I read in JMeter documentation that for recording through proxy I have to invoke from command by giving the proper proxy. I used below code to invoke JMeter.
jmeter -H "proxy address taken from Internet settings" -P "8080" -u "Domain*UserName*" -a "password".
With this JMeter invokes fine and then I start the normal process of creating a thread group and a recording controller.
Now I am changing the internet setting in IE to local host and mentioning the port as given in JMeter (8080). I am keeping the proxy used as it is because without proxy no site will open except for the internal company sites.
Also I have imported the certificate which JMeter uses for the browsers.
This is now resolved
I added : JAVA_HOME variable in User environment variables with value pointing to jre installed on my machine C:\Program Files\Java\jdk1.8.0_60\jre
Also I had to select Java under HTTP Sampler Setting in HTTP(S) Test Script Recorder. (Though I don't get the purpose of this setting).
HTTP Sampler setting changed to Java
After doing above changes script is recording fine under company proxy.
I would recommend you to consider to use chrome extension for jMeter script recording without launching JMeter benefits: You can export the script written to JMeter and/or to cloud as well and run it on the cloud.

jmeter and unknown host exception

Please guide me what all are the settings needs to be done in jmeter while recording an https request through jmeter. I am getting unknown host exception while doing the same.
Thanks
Assumption 1: you have misconfigured JMeter and/or browser. You can get JMeter configured for recording in a couple of clicks using Templates feature.
From JMeter's main menu select File -> Templates -> Recording -> Create
Configure your browser to use the following proxy:
Proxy host: hostname or IP address where JMeter is running
Proxy port: 8888
Use proxy for all protocols (if available) - check
Bypass proxy for local addresses (or equivalent) - uncheck
Assumption 2: you (or your company) are using corporate proxy to access Internet and/or intranet. In that case you need to pass proxy details to JMeter startup script like:
jmeter -H proxy_host -P proxy_port ...
See Using JMeter behind a proxy guide for more information on the domain.
You can also consider an alternative solution which allows recording JMeter test right from browser without having to configure proxies, worry about SSL certificates, etc. Check out JMeter Chrome Extension
For unknown host exception, you should add the domain name and ip address pair in hosts file. For windows, this file is present at C:\Windows\System32\driver\etc\.
For example:
102.54.94.97 rhino.acme.com
For recording HTTP requests through JMeter, you have to configure some elements in your system. Steps are :
1.Add thread to test plan.
2.Add recording controller to plan
3.Add Http Proxy Server to Work Bench
4.address 127.0.0.1 port is 8888
5.Start proxy server
6.go on the recording when finished stop proxy server.
You have to configure your browser setting or install Certificates to record through JMeter. For step by step JMeter Proxy setting follow this PDF Step by step JMeter HTTP(S) Test Script Recorder Configuration

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

Setup JMeter proxy to record activities on a local web application

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.

Resources