Page Load Testing

Hello guys,

I want to know if in Katalon Studio is possible to capture page loads ? Or, do you have some suggestions how can I capture Web Page loading time ? Well, I was working in JMeter, but in it everything is based on an API request/responses.

For a single time, I can easily check page load time in developer tools (Chrome F12). But I want to make it automated, for example when I am making some tests: login, click some things. I want to capture in how much time was loaded login page, in how much time was I redirected inside the website and loaded the page, and so on.
Have you any Ideas ?

hello @brithwulf
Jmeter is a nice tool for this, but it is much easier and more convenient if you follow a path like this.
Add the BlazeMeter plugin to your Chrome browser and record and save everything on the page as you do in Katalon Studio. Take the jmx file ready for Load test and use it directly.
This is very handy.
For more information :
https://emineakturkblog.wordpress.com/2019/01/14/blazemeter-ile-jmeter-ve-selenium-toolari-icin-otomatik-test-setleri-olusturma/

A brute-force method of doing this is to wrap the relevant parts of your script in System.nanoTime() calls, like this:

long startTime = System.nanoTime();
// code to perform some action, and appropriate wait conditions 
long endTime = System.nanoTime();
long responseTime = (endTime - startTime) / 1000000;

This of will give you a rough approximation of the “load” time after any given action (in milliseconds). Of course, it will not give exactly the same result as the inspector, but it should be reasonably close. If you decided to adopt something like this on a larger scale, I would recommend creating a HashMap that stores all of your transaction times throughout the script.

In the end though, if your looking for precise measurements and targeted load test scenarios, you should probably stick with JMeter or another dedicated performance testing tool.

Hope this helps!

2 Likes

Hello @emine, thanks for your reply. I have done things with Jmeter and BlazeMeter, but does it really calculate the web page load time ? Or it only calculates request/responses ? Well, when I’m making some actions, BlazeMeter captures the links. I was looking a soft like LoadNinja if you know.

@brithwulf Hello Again ,
You can get very detailed reports with Listener tools added to JMeter content. In addition, you can save up to 50 users of the reports you have saved in the BlazeMeter tool through the free test run web interface. For more users, you can open your JMX file with JMETER and load test with as many users as you want.

You are right when you say JMeter only tests API requests and responses. It essentially acts as a client in place of your browser. In the absence of a real browser, JMeter does not consider the following two items, which normally are part of the “load time” of a web page:

1.) JavaScript execution time
2.) Rendering time

But here’s the thing: that’s actually a good thing. In general, when we do performance testing, the question we’re trying to answer is “did changes to the application improve or degrade our performance?” With this in mind, the goal when writing performance scripts should be to reduce the number of variables you’re considering to as few as possible (preferably just one: the application code). Browser rendering time and JS execution time are up to the browser you are using, and thus should not really be considered in your test.

2 Likes

So, I can use JMeter as an performance testing tool ?

That’s the primary purpose of JMeter.

Hello,

For this topic Jmeter is out of scope because the utility of this tool is to measure the time of a request/response of an asset on the server.

We need to know if is there a solution/workaround/something that can calculate on the client side the page rendering time.

For example, if I click on button “Open” , how can I measure the time between the click was made and the next page/pop-up was fully rendered?

Thank you

See my solution above. Also, JMeter is not out of scope of this topic, as it was mentioned in the OP.

Hello Brandon_Hein,

Thank you for your solution.
Another question is, how can I be sure that when “long endTime = System.nanoTime()” line is executed my new opened page (accesssed between starTime and EndTime) was successfully and fully rendered ?

Thank you

This was part of the code snippet I provided. You have to write appropriate wait conditions to ensure that your page is “fully rendered”.

In fact … is not out of scope.
Similar how you do with any other tool, you can do also in Jmeter, using custom scripts.
as @Brandon_Hein already explained, the only needed is to write appropriate wait conditions / element loaded detection

e.g you can use it with selenium: https://www.blazemeter.com/blog/jmeter-webdriver-sampler/