BlazeMeter Chrome extension not recording call to fill table - ajax

I am currently working on making a JMeter test for my company's website. I've been using the BlazeMeter Chrome extension to record http requests because I haven't been able to get the certificate working for the JMeter 2.11 proxy server.
On one of the site's main pages there is a large table that is filled by what I believe is an AJAX call. I use the extension to record using the page and add the recorded http requests to my test. However, when I run the test with those requests, none of the requests get responses that are anywhere near long enough to fill the table.
I made sure that the BlazeMeter extension is not just recording high-level requests, and that the cache is disabled. I know that the data is not sent with the initial html page because I can see that the table element is initially empty. Does the BlazeMeter extension not record every request? Or am I wrong to assume that the table is filled by and AJAX call? Or is there another protocol I'm missing entirely?

I'd start by analyzing the actual HTTP requests themselves. At the end of the day ANY performance tool you use to record browser activity is only going to record and playback the requests.
Is there an actual request that you can see your browser making that is not being recorded by the BlazeMeter chrome plugin?

Related

504 Gateway timeout in Jmeter

During manual run on reaching the Home screen, the page keeps loading and the API calls timeout with 504 error(Received the same error during Jmeter execution)
But if the same page(Home screen) is refreshed three times manually, all the previously timed out APIs load successfully (status:200).
But I'm unable to identify how to refresh the page using Jmeter. Any help on this? Thanks!
I tried adding JSR223 preprocessor with the following Javascript -
load("API-url") in the script section but it doesn't seems to work.
As per JMeter project main page:
JMeter is not a browser, it works at protocol level. As far as web-services and remote services are concerned, JMeter looks like a browser (or rather, multiple browsers); however JMeter does not perform all the actions supported by browsers. In particular, JMeter does not execute the Javascript found in HTML pages. Nor does it render the HTML pages as a browser does (it's possible to view the response as HTML etc., but the timings are not included in any samples, and only one sample in one thread is ever displayed at a time).
So in order to "refresh" the page you need to send the same HTTP Request to it using HTTP Request Sampler. If you want to send the same request more than once it makes sense to put in under the Loop Controller
Also given the above quote from JMeter documentation if loading the page triggers some AJAX requests to the API - JMeter won't execute these requests automatically, you will need to create a separate HTTP Request sampler per API request. Also real browsers execute AJAX requests in parallel so if there is more than 1 API request - you need to put them under the Parallel Controller

Jmeter give error "We are sorry but vue-dms-ui-component doesn't work properly witouth Javascript enabled.Please enable it to continue"

In Jmeter, I have used "Recording with Think Time" for an application. Now when i run, in the Response I get message "We are sorry but vue-dms-ui-component doesn't work properly witouth Javascript enabled.Please enable it to continue".
I get this message for all the requests. I have enabled JavaScript in Firefox and then captured the recording.
Attaching the screenshot of the message.
enter image description here
As per JMeter project main page:
JMeter is not a browser, it works at protocol level. As far as web-services and remote services are concerned, JMeter looks like a browser (or rather, multiple browsers); however JMeter does not perform all the actions supported by browsers. In particular, JMeter does not execute the Javascript found in HTML pages. Nor does it render the HTML pages as a browser does (it's possible to view the response as HTML etc., but the timings are not included in any samples, and only one sample in one thread is ever displayed at a time).
So it's not possible to "enable" JavaScript in JMeter.
If JavaScript is being executed on client-side only you can simply ignore this
If JavaScript generates a single network request - you need to mimic it using HTTP Request sampler
If JavaScript generates more than 1 network request at a time - use as many HTTP Request samplers as there are AJAX requests and put them under the Parallel Controller
Don't forget to perform correlation of dynamic parameters as in the vast majority of cases you cannot just replay the recorded network traffic.

Recorded script by blaze Meter & browser is showling all cookies but JMeter is not i.e. ai_user & ai_session, how do I get those cookies values?

Browser shows all cookies when we hit home request
These are the cookies that appear in browser when we execute home page 1st time, but not in Jmeter request
Its JMeter response that shows cookies
My issue is when I execute home page in browser it shows all cookies 1st time when we hit request but in JMeter home request don't show up all cookies as shown in picture.
I want cookies values i.e. ai_user & ai_session and pass them to UserSessionId & AppSessionId in HTTP request header. So how do I get those values? I already user HTTP CookiesManager in my script to handle cookies but can't get ai_user & ai_session cookies values.
Given you send the same request in JMeter as in the real browser you should get the same response so double check all the request details like:
URL
Headers
Body
etc.
Try using clean browser session or at least private mode
Look at Set-Cookie header for the first request and see if the cookies you're looking for are there. It might be the case that the cookies are being set by JavaScript and as per JMeter Project main page
JMeter is not a browser, it works at protocol level. As far as web-services and remote services are concerned, JMeter looks like a browser (or rather, multiple browsers); however JMeter does not perform all the actions supported by browsers. In particular, JMeter does not execute the Javascript found in HTML pages. Nor does it render the HTML pages as a browser does (it's possible to view the response as HTML etc., but the timings are not included in any samples, and only one sample in one thread is ever displayed at a time).
So if this is the case you will need to mimic the JavaScript code logic using JSR223 PostProcessor or just extract the values from the response if they are there using other suitable Post-Processor

Performance test on a webpage which loads data from multiple API's

We have a webpage which will load data from multiple api's as configured by the users. While doing performance test of this page, In HTTP request I have added this page URL and executed the script. To my surprise, the script executed successfully with status as 200 as I dig into more I changed the drop down(In View Results Tree) from Text to HTML(Download Resources) and I don't see any page data in the response. Can someone help me with this. I'm not sure how to proceed with performance testing on this particular page.
As per JMeter project main page:
JMeter is not a browser
JMeter is not a browser, it works at protocol level. As far as web-services and remote services are concerned, JMeter looks like a browser (or rather, multiple browsers); however JMeter does not perform all the actions supported by browsers. In particular, JMeter does not execute the Javascript found in HTML pages. Nor does it render the HTML pages as a browser does (it's possible to view the response as HTML etc., but the timings are not included in any samples, and only one sample in one thread is ever displayed at a time).
My expectation is that your "multiple APIs" are triggered by JavaScript calls using AJAX technology. Given JMeter doesn't evaluate JavaScript it doesn't execute the AJAX requests which are being called by the real browser therefore you don't see the data coming from the APIs.
In order to get the browser-like behaviour you need to send the same requests which real browser sends, you can record them from the real browser using HTTP(S) Test Script Recorder or JMeter Chrome Extension
Also be aware that real browsers execute AJAX requests in parallel, in order to properly simulate browser's network footprint you need to place the HTTP Request samplers representing these API requests under the Parallel Controller

Load Testing in Struts2 Application - JMeter

I am trying to do a load test using JMeter for the first Time.
My approach is to test each page one by one.
The main page is like http://localhost:8180/myapp/login.do?actionType=login(I hardcoded the credentials)
I am able to reach this page without any problem.
I created a HTTP request component and able to see the response without any issue.
In the main page there is a button which populates the report, in the browser , the url is like
http://localhost:8180/myapp/mainmenu.do
But when i create a HTTP request it is reaching but shows the security error page in the 'Response
Data' as Due to security reasons, we still recommend you to close this window.
can someone guide me how to test the other pages without these security errors. This is a struts2 Web application.
No matter what technology is being used under the hood of the web application you're testing you should stick to one simple rule:
Well-behaved JMeter test must send exactly the same requests as real browser
It includes:
Same number/sequence/nature of the HTTP Requests
Same HTTP Headers (including Cookies)
any dynamic values need to be properly correlated
Once JMeter will send the same requests as real browser does it should receive the same responses. So just use a 3rd-party sniffer tool like Fiddler or Wireshark to capture the requests originating from browser and JMeter and amend JMeter's configuration until the requests start looking exactly the same. This should resolve your issue.
Solved the issue by adding HTTP Cookie Manger and
set Cookie Policy as Standard
click HTTP Cookie Manager
and click save icon on the top.
Source
https://jmeter.apache.org/usermanual/build-web-test-plan.html#adding_cookie_support
Thanks #Dimitri T and #Roman C for their valuable suggestion.

Resources