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 ?
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.
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.
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 ?
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