Jmeter - waiting for a web grid to load - testing

So we are tasked with doing automation against one of our web applications that has a lot of Ajax calls. We can't seem to get the Test Recorder to work, so right now we are manually writing out those requests. There is a particular web grid that contains about 100 rows x 20 columns of data. We are trying to measure how long it takes to load up that grid. The response data doesn't have any information on the grid too. Do you guys have any idea how to tackle this?

Using HTTP(S) Test Script Recorder will not help too much as it generates sequential calls while AJAX requests are parallel.
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 I would recommend reconsidering your approach and use i.e. WebDriver Sampler plugin in order to measure page loading time using a real browser instance. This way you will also be able to get extra information from the Navigation Timing API
If for some reason WebDriver Sampler approach is not acceptable for you - make sure that JMeter sends the same requests as real browser does:
Capture requests which are being sent by JMeter and by the real browser using a sniffer tool like Wireshark of Fiddler
Compare the requests, identify the differences
Amend JMeter configuration until requests would be exactly the same (apart from dynamic values in cookies or parameters)
Also be aware that you can mimic AJAX requests parallel execution in JMeter using Parallel Controller plugin.

Related

API requires HMAC authentication JMeter

I am getting error when setting up API test in Jmeter, same is working fine in POSTMAN.
Using HMAC authentication.
I have some basic knowledge of Jmeter new to the tool.
https://developer.firstdata.com/marketplace/api/authentication.html?shell#authentication.
Postman Pre-request Script
And Postman Header details
Postman API response is working fine.
Same as been work in Jmeter but I' getting response message as {"message":"HMAC signature cannot be verified, a valid date or x-date header is required for HMAC Authentication"}
I have added JSR223 PostProcessor and HTTP Header Manager.
and here are the details for both image attached below.
** JMeter - JSR223 PostProcessor**
JMeter HTTP Header Manager
Copying and pasting code from Postman won't work in JMeter because:
Postman is a browser extension and is capable of executing JavaScript and according to 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).
If you're trying to run JavaScript code you need to choose the appropriate language from the dropdown
JMeter doesn't include CryptoJS library, you will need to download it and load before running the JavaScript
Since JMeter 3.1 it's recommended to use Groovy language for scripting as this option provides maximum performance especially when it comes to "heavy" cryptographic operations so I would recommend re-writing your code in Groovy
I see you like screenshots so I include an example implementation as a screenshot here:
More information on Groovy scripting in JMeter: Apache Groovy - Why and How You Should Use It

Does GET endpoint triggers underlying APIs on request (with Postman or JMeter)

I'm creating load testing with JMeter.
We have A Single Page Application (React).
Let's say I need to check the endpoint
GET /foo
When you go to that endpoint via the browser it triggers API endpoints (javascript fetch) to retrieve data. Let's say 2 endpoints
GET /api/fooData, GET /api/fooCalendar
My question is: If I request GET /foo with JMeter (or Postman for instance), will it trigger the other endpoints behind the scene like a normal user flow, or I would need to manually check all the endpoints that are being triggered?
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 you will have to create separate HTTP Request samplers for each JavaScript-driven calls. If the calls are made in parallel - it would be better to put them under the Parallel Controller as JMeter executes Samplers sequentially (upside down)

Is it possible in Jmeter to get overall response time with including rendering of page in browser

I have a requirement from client that The overall response time (end to end time including rendering of page in browser) should be 3 secs for all the requests.Its an API with frontend.
As i know jmeter handles server side response time, even if i add embedded resource it just downloads java script ,images etc but doesn't act as a browser. Is there any way where i can get The overall response time (end to end time including rendering of page in browser) .
Could some please help me out with this.Thanks..
You can use JMeter Plugin WebDriver Sampler with associated -Driver Config Elements to achieve overall response time.
Following Links could be useful
Web Driver Tutorial
Web Driver Sampler
You cannot, 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 the only way of getting client-side metrics like rendering time you need to use a real browser, for example kick off one using WebDriver Sampler. Metrics can be obtained from Navigation Timing API via WebDriver.executeScript() function

How can i use Jmeter as a normal browser?

I am using jmeter for performance testing
but jmeter only accept JS call they can not pass request like URL.
so my question is that how can i user jmeter as a normal browser for
load testing ?
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).
It is possible to configure JMeter to behave more like a real browser when it comes to normal HTTP requests given you:
Tell JMeter to download embedded resources (scripts, styles, fonts, images, sounds, etc.) in parallel
Add HTTP Cache Manager to mimic browser cache when it comes to handling the aforementioned embedded resources
Add HTTP Cookie Manager to represent browser cookies
Add HTTP Header Manager to represent browser headers
JMeter will not automatically kick off the requests triggered by JavaScript as it doesn't have full JavaScript runtime so you will have to add a separate HTTP Request sampler per such a request. If you need to simulate several AJAX requests - consider putting them under the Parallel Controller as browsers execute AJAX request simultaneously

Script for checking siebel application documents is viewable or not

As a part of routine healthcheck in Siebel application we open few documents from different navigation in Siebel application and check whether it is viewable in browser or not.
If i want to automate then can we prepare some script in which it returns the response code of the documents.
For ex :- 404 error code means not available. In the same way html response code between 200 to 400 means everything is alright.
OR
Any other ways in which i can know whether documents are viewable in browser or not.
Given that the browser directly accesses the documents from the browser, it would be best to record the manual executed event and then replayed. Tools like JMeter or SoapUI. As it is probably a few requests at most one can look at recreating them using wget, or curl.
It is also possible to make this part of a larger test approach and include them in a open source test approach like Robot Framework. It has a HTTP Requests library that allows you to perform tests using http requests. This in addition to the Web service, web browser, database and many other types of libraries that allow an integrated test approach.