6

I am new to JMeter and trying to run a test from behind a corporate proxy. I read on the same from apache site and followed the same process so as to run the test. However, i am still unable to record a test from behind the proxy.

This message always appears after pressing on 'Start' recording:

enter image description here

After that, I have changed apache port to 8000 as in below and made it different

This time after pressing on start was this message

enter image description here

2
  • If you're talking about your computer's network connection requiring a proxy (when you are not even using JMeter that is), then see sqa.stackexchange.com/a/6492/11978
    – Pacerier
    Commented Nov 6, 2015 at 11:11
  • Change your port setting to 8070 or any other port
    – smriti
    Commented Mar 4, 2019 at 9:15

5 Answers 5

3

You need to install CA certificate to the browser If you have installed JMeter then map for folder structure in windows, to find the root ca certificate, please follow the below steps & Choose the following options:-

  1. Tools / Options

  2. Advanced / Certificates

  3. View Certificates

  4. Authorities

  5. Import certificate from path ...\JMeter\bin\ApacheJMeterTemporaryRootCA.crt

  6. Browse to the JMeter launch directory, and click on the file ApacheJMeterTemporaryRootCA.crt, press Open

  7. Click View and check that the certificate details agree with the ones displayed by the JMeter Test Script Recorder

  8. If OK, select "Trust this CA to identify web sites", and press OK

  9. Close dialogues by pressing OK as necessary

1

Yes, you are on the right track, that last message should have generated certificate in BIN folder of your JMeter, i.e.

your jmeter/bin

Certificate name will be: ApacheJMeterTemporaryRootCA

Certificate

You just need to import that certificate in browser in which you are going to record your script using JMeter.

8
  • 1
    actually I am not sure you got what I mean. As I know , jmeter should have same port as in browser setting. and This same port we use to connect to the internet without it we cannot run our application . I am confused with this . The first message appears if this was the case. The second message appears if I change port in jemter. at the end what shall I do to enable test recording?? –
    – tester
    Commented Sep 14, 2015 at 9:55
  • Second message is perfect. it comes only if you have selected proper port which is not busy and available for jmeter. To enable test recording , as I mentioned , you need to import certificate in browser generated by jmeter as per second message. Also do not forget to set proxy in browser also. Commented Sep 14, 2015 at 9:58
  • he application I am going to test must have the correct http proxy and port defined in the browser in order to connect to the internet. How do you require to change it , it won't work if it is not 8080
    – tester
    Commented Sep 14, 2015 at 10:02
  • 1
    Dear , I did what you mentioned, I used a diffident port and update the certificate with the browser but the message of certificate still appears. I made sure it was same configuration as in browser.
    – tester
    Commented Sep 14, 2015 at 11:03
  • 1
    Certificate message will be there always when you click on start button. So do not worry about that message. just do recording. I hope that will work.. Commented Sep 14, 2015 at 11:06
1

Take the following steps:

  1. Change default JMeter HTTP(S) Test Script Recorded port to be different from default 8080. The easiest and quickest option is using "Recording" template (File -> Templates -> Recording). See How to Save ‘Loads’ of Time Using JMeter's Template Feature for instructions on using existing and creating new templates.
  2. Configure your browser to use localhost as a proxy host and port 8888. Make sure that "no proxy for" input is blank or doesn't contain stuff like 127.0.0.1, localhost, ::1
  3. If you're sitting behind the corporate proxy - you can "tell" JMeter to use your company proxy settings via the following command-line arguments:

    -H, --proxyHost <argument>
        Set a proxy server for JMeter to use
    -P, --proxyPort <argument>
        Set proxy server port for JMeter to use
    -N, --nonProxyHosts <argument>
        Set nonproxy host list (e.g. *.apache.org|localhost)
    -u, --username <argument>
        Set username for proxy server that JMeter is to use
    -a, --password <argument>
    

    See full list of command-line options to learn about other command-line arguments which you may find useful

0
  1. First add a Recording Controller in your Thread Group.
  2. Next add a HTTP(s) test script recorder in the work bench.
  3. Click on the HTTP(s) test script recorder .
  4. In the Global Settings, change port from 8080 to any other number say - 7777. enter image description here

  5. Go to Mozilla Firefox Options.

  6. Go to Advanced settings.
  7. Go to Network tab.
  8. Go to Connection Settings.

enter image description here

  1. Change to Manual proxy settings and change to port to 7777
  2. Save the settings.

What was happening when you were trying to run the script earlier. Actually the port on which you are trying to run the script on, is already in use by some other application and that is why you are getting the error.

3
  • the application I am going to test must have the correct http proxy and port defined in the browser in order to connect to the internet. How do you require to change it , it won't work if it is not 8080
    – tester
    Commented Sep 14, 2015 at 9:44
  • I guess you are recording using the Firefox browser. The thing is, port at both the side i.e. you script and the browser should be same and secondly that port should be free i.e. It should not be in use by some other application.
    – Faiz
    Commented Sep 14, 2015 at 10:02
  • You only need to confirm that the port on which you are recording shud be set in chrome or firefox. Also it should not be in use by any other application.
    – Faiz
    Commented Sep 14, 2015 at 11:35
0

You can also use Burp Suite application to set proxy.

2
  • Can you explain bit more in detail, how this will solve the OP issue of using JMeter.
    – Dhiman
    Commented Sep 16, 2015 at 13:54
  • Using this tool you can set proxy address, port, user name or password. After that you should set http address for jmeter, the machine which you install Burp suite. Commented Sep 18, 2015 at 10:06

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.