JMeter : How to record HTTPS traffic? - performance

I'm using Apache JMeter 2.3, which now supports "attempt HTTPS spoofing" under the Proxy Server element.
I've tried this on several different servers, and have had no success.
Has anyone been able to successfully record from an HTTPS source with this setting?
Or barring successfully recording, can anyone share a work-around? When available, I simply have HTTPS turned off at the server level, but this is not always feasible. Thoughts?

Starting from JMeter 3.0 default port for the HTTP(S) Test Script Recorder is 8888
The easiest way to configure recording is using JMeter Templates feature. From JMeter's main menu select:
File -> Templates -> Recording -> Create
Don't forget to start the recorder :
In JMeter < 4.0, Expand "Workbench", if >= 4.0, ignore this step
Select "HTTP(S) Test Script Recorder"
Click "Start" button
You will see a message regarding Root CA Certificate. Click OK:
it is OK, it informs you JMeter has created a Root Certificate Authority that you need to import in your browser to be able to record correctly HTTPS traffic.
To Import this Root CA certificate in Firefox (it is located in jmeter/bin folder) for example:
Configure browser to use JMeter as proxy:
It is now Ok.
You can navigate to your application, samplers will be created under "Recording Controller" which is under "Thread Group" element

While the JMeter proxy already has the ability to record HTTPS requests, a Chrome Extension that creates JMeter script came out recently:
https://chrome.google.com/webstore/detail/blazemeter-the-load-testi/mbopgmdnpcbohhpnfglgohlbhfongabi?hl=en
It uses a BlazeMeter as the middleman (a commercial JMeter in the cloud service) but you can use their free service forever and still use the plugin to record a JMX script and download it locally to your own machine even if you never use any of the paid plans.

What I do is:
Go to my website using my web server's IP-address (i.e. http://2.2.2.2/login.html)
Start the recorder and run through my test case
Stop recording
Replace all values of the IP address with the domain name (i.e. replace 2.2.2.2 with yoursite.com) from the HTTP Request Samplers
Set the protocol to https in the HTTP Request Samplers
If you have more than a few pages, it's easiest to create an HTTP Request Defaults item, and set your domain name and protocol there.
FYI, I'm using the latest stable build as of 2010-05-24: Jmeter 2.3.4 r785646.

The newest version of Jmeter (2.4) now supports HTTPS recording. Rejoice!
More details:
http://wiki.apache.org/jmeter/JMeterFAQ#Can_JMeter_record_HTTPS_requests_using_the_recording_proxy.3F

Is there any other way to record HTTPS than Bad boy and Https spoofing?
Yes--use a nightly build of JMeter, e.g. version r922204.

Https recording is successfully working in new version of Jmeter 2.9 as of today. I had to import proxy certificate and play around with Firefox to get this working.
Refer this link for more information
Https recording using Jmeter

Yes, I have used it with "attempt HTTPS spoofing" on. Things are simple enough:
Turn HTTPS Spoofing on (of course).
Make sure that the browser sends Http request to Jmeter, so that Jmeter can record it and then send the encrypted request back to the server. So, the URL in the browser should start with http:// (and not with https://). The details could be found in my blog.
Please let me know if it works for you.

I am using Webscarab to record https and ajax conversations.
It workd fine. I extended the Webscarab with export function for Jmeter.
Bugzilla 48898.

Related

Unable to record application running on local host in Internet explorer using JMeter Test script recorder

I am trying to do record a test script using JMeter (version 4) Test Script Recorder for performance testing of my application. After configuring the proxy, The recorder is not recording my application URL running on localhost in Internet Explorer (IE 9). But other URLs are getting recorded in JMeter. I tried to record my application using Chrome which is working fine.I have unchecked the Bypass proxy server for local address in Proxy settings.
I recommend you to use Mozilla Firefox to record your script because Firefox allows you to manage proxies and certificates independently of system settings.
Get more information about recording:
Apache JMeter HTTP(S) Test Script Recorder
JMeter Recording Guide
Make sure to check Use the same proxy server for all protocols box in the "Advanced" tab of the Internet Explorer proxy settings and there are no localhost, 127.0.0.1, etc. in the "Exceptions"
Some applications cannot route traffic to a local proxy server so you may need to add a loopback adapter
If you're recording an application which operates over HTTPS protocol you will need to install JMeter's self-signed certificate into Trusted Root Certification Authorities:
It doesn't really matter which browser you're using for recording as applications mostly differentiate the browsers basing on User-Agent header so you can record using whatever browser and then change User-Agent string in the HTTP Header Manager to IE9
According to JMeter Best Practices you should always be using the latest version of JMeter so consider upgrading to JMeter 5.0 (or whatever is the latest version available at JMeter Downloads page)

Can not record browser action in jmeter

I am using apache-jmeter-2.6. I want to record browser action using HTTP Proxy Server. But The actions are not recording.
I have defined HTTP Request Defaults under Thread Group,I have given value for the server name that looks like this:
http://www.xxxxx.com:81/
And I left the Port Number field empty as it is given with the Server Name.
In HTTP Proxy Server under workbench, I have given the Port value:81 and added ".*.html" in URL Patterns to include.
I have set the proxy server setting in firefox browser with Port:81 and Http Proxy: www.xxxxx.com
Now when I start the proxy server in jmeter and do different actions in my browser, i get nothing in my listener which is 'View Result Tree'.
I have searched for the ApacheJMeterTemporaryRootCA.crt file in different directories of my pc so that I can install it in my browser but did not find it anywhere, seems it is not created.
I have also deleted proxyserver.jks and then tried everything again, but no success.
What am i doing wrong here? How do i fix this?
My java version is 1.8.0_77.
Thank You.
First of all I recommend you to upgrade your JMeter version.JMeter 2.13 version is available.The performance of JMeter is being constantly improved, so users are highly encouraged to use the most up to date version.
Ensure you always read changes list to be aware of new improvements and components. You should absolutely avoid using versions that are older than 3 versions before the last one.
Here is the step by step process of recording browsers action.
Step1: Open your Firefox browser and from Network Connection settings configure the proxy server as HTTP Proxy: 127.0.0.1, Port: 8888
Step2: Run your Jmeter.bat file and open Templates under File dropdown list and click "Create".
Step3: Expand Work Bench and select "HTTP(s) Test Script Recorder". And click "Start" at the bottom of the page.You will have two pop up to Allow Firewall and Temporary Root CA Certification Installation.Allow all those and now go to your browser and do your browser activity.When its done "Stop" the
HTTP(s) Test Script Recorder.
Step4: After this you will get the recorder script in JMeter with all your activity in the browser.It will automatically update under Thread Group.This script will contain all your page requests during browsing activity. Sample script after recording is shown below.
Hope this will work for you.
You need latest JMeter first! Download here.
Check this tutorial on recording.
ApacheJMeterTemporaryRootCA.crt can be found in JMETER_HOME/bin folder.

Jmeter Probably waiting for user to authorize the certificate

All
When i am trying to record https urls with jmeter, i am getting below message in log:
jmeter.protocol.http.proxy.Proxy: [64432] Empty response to http over SSL. Probably waiting for user to authorize the certificate for XXXXXXX:443.
Its not loading any pages of our application.
Can anyone please help me how to resolve this issue?Thanks
Theju
First read:
http://jmeter.apache.org/usermanual/jmeter_proxy_step_by_step.pdf
http://jmeter.apache.org/usermanual/component_reference.html#HTTP%28S%29_Test_Script_Recorder
Among resolutions for your issue:
Install in the browser as described in documentation the Fake Certification Authority created by JMeter
Call https URL in the browser and accept certificate, then start recording your scenario
Have you added JMeter's self-signed certificate to browser's exception list?
If so - try removing the certificate and starting over.
For other troubleshooting options and recommendations see Recording HTTPS Traffic with JMeter's Proxy Server guide.
I suggest using SmartMeter Recorder. You will avoid all isues with setting up the proxy. SmartMeter Recorder uses its own Chrome plugin and works out of the box. Read the article for more info.
First of all for performance testing you should have application setup without the certificates otherwise you are testing results will differ. Your objective should be to test actual calls and those should be isolated.
If you still insist doing with certificate then you need to register JMeter certificate with browser which you are using for recording. You can find that in JMeter bin directory. Just register with your browser which you are using fir recording.

JMeter: Recording tests without proxy server

At the place where I am working, proxy settings are not allowed. Is there any way by which I could record HTTP sessions and use them in JMeter during replay?
There is a Google Chrome Extension which allows HTTP Requests and associated cookies, headers, think times, etc. recording right from browser without having to worry about proxies and SSL certificates.
Another option is using BadBoy software which can export scripts to JMeter.
However there should not be any problem to launch a JMeter proxy on your workstation as it doesn't broadcast anything hence shouldn't be visible.
Firstly which browser you are using, if using chrome use BlazeMeter chrome extension, download it from google it is free
Secondly if using forefox use the configure the recording controller in your test plan and then use HTTP test script recorder it will work

How to record using jmeter Http proxy server with "Automatic proxy configuration URL" (i.e .pac file )in proxy in browser

In Jmeter, I am not able to record any external website from our company proxy server.
I have to use option "Automatic proxy configuration URL" (i.e one .pac file )in to browser if I dont know how to configure it in Jmeter to do successful recording.
Any idea?
PAC fiels contain javascript which is executed by the browser to decide which proxy URL they want to use. JMeter is not a browser so it does not run this code. The solution is simply to resolve which proxy this script returns and input this value into JMeter directly, you can do this using the dev tools on most browsers, or just ask the IT dept. that maintains the thing to tell you the direct address.
Same question with solution in Jmeter mailing archive.
Jmeter: Using a Proxy Server.

Resources