Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Not able to do Jmeter UI recording due to CORS error

Tags:

jmeter-4.0

We are facing CORS issue in Jmeter UI recording:

CORS request did not succeed

We have website uat.torchmarkets.com which internally calls tradeuat.torchmarkets.com in which has security check for Cross Domain Request. Sharing. We want to do UI recoding for uat.torchmarkets.com

Below is jmeter UI recorder setting

[JmeterUIRecordingSetting

Below is proxy settings in browser. The subdomain loadtesting.torchmarkets.com is whitelisted.

[BrowserProxySetting

Below is there CORS error

[CORSError

Any help to solve this issue will be much appreciated!

Thanks in advance!!

like image 617
Arul Avatar asked Nov 17 '22 01:11

Arul


1 Answers

In my case the CORS error vanished after importing JMeter's certificate.

In JMeter's bin folder, you will find a .crt file. This one needs to be imported into the browser. I have tested it only with Firefox.

  1. In Firefox, go to Privacy & Security settings section where you find View Certificates...
  2. Select the Authorities tab
  3. Click on Import... and browse for JMeter's certificate
  4. Check This certificate can identify web sites. and confirm

From that point on you should see no further CORS errors, until the certificate expires, which is by default 7 days.

Optionally, in the bin folder of JMeter find the file jmeter.properties and change the validity period of the certificate if you need it for longer than the default 7 days by changing the value proxy.cert.validity and let the certificate regenerate.

like image 180
Matt Avatar answered Mar 05 '23 19:03

Matt