Recording a test by Jmeter causing errors "NET::ERR_CERT_AUTHORITY_INVALID" & "ERR_PROXY_CONNECTION_FAILED" & "..." JMeter proxy certificate** - proxy

started recording my test on macOS, with below steps and I am receiving BELOW RESULTS
1. ERR_PROXY_CONNECTION_FAILED
"If you use a proxy server…
Check your proxy settings or contact your network administrator to make sure that the proxy server is working. If you don't believe you should be using a proxy server: Go to Applications > System Preferences > Network > Advanced > Proxies and deselect any proxies that have been selected."
2. Went to JMeter result tree
Response message:
2.1 Connection reset
ensure browser is set to accept the JMeter proxy certificate 443
2.2 Response message:Received fatal alert: certificate_unknown
ensure browser is set to accept the JMeter proxy certificate
JMeter test Steps:
Go to Jmeter and select "Recording" from "Templates"
provided paramters due creation
hostToRecord: www.tesla.com/en_eu
recording file: recordingtesla.xml
scheme to record: https
STRANGE THING: Template was created, but going to "User Defined Variables" I see another value provided (another website, which I have used couple of times in my previous tests?)
STRANGE THING 2 Going to "Https Test Script Recorder, field domains use the same website, from point 3 (again i HAVE PROVIDED tesla and I can see a previously used website??)
HTTP(S) Script recorder and port set to 8888 (saved)
User Defined Variables ->
name: host, value: AGAIN the same website from point 3 &4 (used previously, not putting it for this test)
name: scheme, value: https
RECORDING
Going to "HTTP(S) Test Script Recorder", pressing start button
-(Root ca showing up)
-Target Controller is a Recording controller
-Grouping is Do not group samplers
-Went to tesla website (was already opened before I have pressed "Start"
-I click someting on tesla website and test stopped
1. DNS Servers 8.8.8.8
2. Proxies settings for all of below (and selected) is localhost: 8888
Web HTTP
Secure Web HTTPS
FTP
SOCKS
Streaming
Gopher
3Auto Proxy Discover (without selected localhost & 8888- no fields for this)
Jmeter certyficate should be valid till 2024, I have renewed certyficate, following this instruction -> https://stackoverflow.com/questions/64043676/cannot-update-jmeter-root-ca-certificate​
BUT IN KEYCHAIN
**Expired: Monday, 26 December 2022 at 10:52:55 Central European Standard Time
marked as trusted **
4. am using Chrome browser

Delete the certificate from the keychain completely
Delete proxyserver.jks and ApacheJMeterTemporaryRootCA.crt files in "bin" folder of your JMeter installation
Clear your Chrome browsing history completely
When creating the recording test plan from the template use www.testla.com without any paths
When you start the HTTP(S) Test Script Recorder JMeter will generate new ApacheJMeterTemporaryRootCA.crt file. Default validity is 7 days unless you change proxy.cert.validity property
Import this certificate into your browser. At this stage I would suggest using Firefox instead of Chrome because:
Firefox has its own certificates storage and Chrome uses the system one
Firefox has its own proxy configuration and Chrome uses the system one
It would be also a good idea to exclude other domains than tesla.com from recording scope
Your recording should be successful
Also be aware of an alternative way of recording a JMeter test: JMeter Chrome Extension, in this case you won't have to worry about proxies and certificates

It works for now but, still seems not correct
When I set proxy.cert.dynamic_keys false and it finally started recording with some 200 statuses:
Use dynamic key generation (if supported by JMeter/JVM).
If false, will revert to using a single key with no certificate.
Defaults to: true
BUT SOME TESTS ARE STILL 443 because of cert
Response message:Connection reset
ensure browser is set to accept the JMeter proxy certificate
Tried your recommendations also uninstalled and installed JMeter again, cleared and using Firefox for now, cert is valid until 16.01.2023, I have set jmeter.properties file to “#proxy.cert.validity=365” (with hash) and I have checked Firefox -> settings -> cert view and there is 16.01.2023 so looks like again I have to uninstall and install again?
Is it correct that when test finished and I want to user browser + internet again I need to go to Firefox settings -> proxy and set back from manual mode (localhost 8888 + https) to no proxy?
If I stay with manual there is an error:
“The proxy server is refusing connections
An error occurred during a connection to www.tesla.com.
Check the proxy settings to make sure that they are correct.
Contact your network administrator to make sure the proxy server is working.”

Related

Jmeter webui fails to record

I have been trying to setup my test environment for Jmeter recording with WebUI. I had followed all the steps as mentioned in the guide i.e. proxy server setting and uploaded certificate in browser as well. I starting jmeter through command prompt
jmeter -H my.proxy.server -P 80 -u username -a Password -N localhost
When I record anything with these settings jmeter doesn't record anything and the log shows no error. Logs read Start recording and stop recording. But nothing gets recorded/captured
What can be the root cause of the problem?
1. I need to talk to support team to open some settings?
2. I am using my company proxy server name with port 80
Thanks
Could you add the Proxy Scheme to use parameter (-E https) when you start the JMeter?
Could you stop the JMeter Proxy (HTTPS Test Script Recorder) and check if you can access the application through the web browser? If you can access the application when proxy is stopped then you will have to configure (recheck) the browser's proxy settings.
If you get error proxy not found error on your browser then your browser is trying to access the application through the proxy.
3.1 Can you check if you have set HTTPS Domains in HTTP(S) Test Script Recorder
3.2 Have you set any request filtering? Could you remove all the request filtering and give a try?
3.3 Trust your certificate if not expired. Default vapidity period of the certificate is 7 days. Create a new certificate and reinstall it on your browser.

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)

The proxy server is refusing connections JMeter

I am trying to load test for my web application. I followed all the steps as per JMeter guide. After that enable proxy server also using port number 8080.
Please take a look my proxy server description in Firefox:
Please check my JMETER Configuration
Output after did all configuration
I am new for JMETER load testing, hope you guys will help to solve this problem.
Remove localhost and 127.0.0.1 from "No Proxy for" area in Firefox
Since JMeter 3.0 default port for HTTP(S) Test Script Recorder is 8888 so you either need to switch it back to 8080 in the HTTP(S) Test Script Recorder or configure Firefox to use port 8888. See Bug 59006 for details
You will have slightly better JMeter configuration for recording if you use "Recording" template, from JMeter main menu choose File -> Templates -> Recording and click "Create".
The main problem is Firefox expects that you would have installed a trusted Certificate before listening for requests using proxy server (via your port number 8080 as quoted above). Note that this is a Trust issue. Firefox does not trust your requests.
To resolve this issue, see below steps:
In Jmeter, from "HTTP(S) Test Script Recorder" once you click "Start" button to start recording and listening to requests, Jmeter creates a temporary "Root CA Certificate" in your Jmeter "bin" directory/folder automatically.
This certificate has to be uploaded on Firefox to enable Trust.
Note that the certificate has validity of 7 days. See screenshot below:
Next go to your "Firefox preferences" and click "Privacy and Security" Tab, scroll down to the "Certificates" section and click "View Certificates" to upload the generated temporary CA Certificate in the previous step (step 1). See image below:
Click the "View Certificates" button to add the temporary Root CA Certificate generated above. Note that the CA Certificate is located in your Jmeter "bin" folder.
See the certificate in the bin folder below:
Upload the Certicate as seen in the screenshot below:
Finally, as soon as the Root CA Certificate has been added to Firefox successfully, go ahead and start recording your requests. Everything should be work without issue.
Cheers!
After adding the certificate to your browser you have to hit 'Start' on the recording on jmeter before you access your website on the browser.
For jmeter test recording, you've to follow this sequence-
Add jmeter test script recorder
Set up the proxy ( you've done till here)
Click start in test script recorder(you must click start only then your links(pages) will load in browser )
Add the certificate generated in jmeter/bin folder(you only need to do this once)
then you can browse using the firefox browser

JMETER not recording a particular site

Jmeter is not recording a particular site. However, it did record for the very first time, later something might have happened, below is the set up.
HTTP(S) Test Script Recorder > port 7878
Firefox > localhost (7878)
open firefox > start HTTP(S) Test Script Recorder and open WWW.xyzabc.com
Jmeter records perfectly as expected.
Now, after sometime i did the same, this time nothing is being recorded however, the site got opened on firefox.
Additionally, when i have stopped recording on jmeter, i was still able to open the site and perform actions on firefox, but for other sites i get "The proxy server is refusing connections"
Can anyone please explain this behaviour?
A couple of assumptions:
Your site uses HTTPS transport and Firefox isn't configured to record HTTPS traffic
Your site is running on your local machine and Firefox is configured to not to use proxy for local addresses.
In Firefox network configuration make sure:
Use this proxy server for all protocols box is checked
No Proxy for: input field is empty
If it doesn't help you can try out the following:
Add the next line to user.properties file
log_level.jmeter.protocol.http.proxy
Restart JMeter to pick the property up
Look for anything suspicious in jmeter.log file
If nothing help you can consider an alternative way of recording a JMeter test - JMeter Chrome Extension
Here is the step by step procedure to record a scenario in JMeter.
The easiest way to use recording is from "Templates" .
Step1: Open your Firefox browser and from Network Connection settings configure the proxy server as HTTP Proxy: 127.0.0.1, Port: 8888.
See image here
Step2: Run your Jmeter.bat file and open "Templates" under File dropdown list and click "Create".
See image here
Step3: Expand WorkBench 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 it's done "Stop" the HTTP(s) Test Script Recorder.
Step4: After this you will get the recorded 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 here.
If it's HTTPS, then you have to add its certificate to jmeter.

using JMeter proxy recorder behind company proxy with SSL manager

Hi I am facing following issue when try to use JMeter proxy recorder behind company proxy
There are two environments one is not using company proxy(QA env) other is using company proxy(UAT env)
Also both sites are using client side certificate to identify user(saml2).
When recording in the QA environment I only need to use ssl manager and when I start the jmeter proxy jmeter will ask for browser certificate password. After providing that I can successfully record the requests.
But when access the UAT env directly I have to set the browser proxy setting (webprox.corp.net and port 2212)
So to record the same application I started JMeter using following command
jmeter.bat -H webprox.corp.net -P 2212
also set the browser proxy settings to localhost and 8080(same as jmeter proxy server settings)
Jmetr recording start fine and requests are captured but it does not evaluate the browser certificate which is loaded in SSL manager. Therefore I am unable to recorded correct scenario as connection says not authorized due to browser certificate unidentification.
Any suggestions on this pls
I have found out the solution for above issue
As stated we can start the JMeter using jmeter.bat -H webprox.corp.net -P 2212 -N localhost (you can use other parameters as required like username and password for the proxy)
Load the valid browser side certificate(not the JMeter root CA) in to the SSL manager(Assume you are not loading certificates from java Keystore)
The main point I have missed was the value in JMter Work Bench > HTTP(S) Test Script Recorder > HTTP Sampler Setting > Type
Had to use Java implementation as Type (or you can change the value and check)
After completing above configurations I have successfully recorded the script from behind the cooperate proxy.

Resources