I want to execute Ajax requests in JMeter. I record my test plan with JMeter and BlazeMeter but none can handle Ajax requests. How can I solve my problem?
Or is there any tool that can send concurrent Ajax requests?
Thanks in advance, M.A
By default, Ajax requests can't be simulated by JMeter as it does not process .js
files (As of 3.1 version). You have to explicitly add the requests (HTTP Samplers) for AJAX requests.
Use Network
tab of a browser (F12 option) and filter the traffic by xhr
, which shows only AJAX requests. Add those requests as HTTP Samplers in the script at the point you needed in the Test Plan.
Browser can process .js
files, hence AJAX requests are sent from the browser. When you record the script using HTTP Test Script Recorder
, as you are using the browser to navigate, even AJAX requests (originated from js files) will also be added/recorded to the Test Plan.
Since JMeter can't process .js
files due to limitation, manually add the AJAX requests (nothing but HTTP Get or Post requests) using HTTP Sampler, if you are building the Test Plan
without HTTP Test Script Recorder
.
Note: If you are using HTTP Test Script Recorder
, no need to add them manually as they are already recorded in the Test Plan.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With