0

I've an application that have some room for performance improvements. Our customer has requested some performance measurements on the Client (Browser) side, and I'm trying to use testcafe to have some execution time indications.

One option is to have people accessing the different features, activating in Chrome the development tools, and taking note of DOMContentLoaded values, too boring, error prone and time consuming.

Using testcafe we can do begin-end measurements, but because testcafe is loading the pages through it's proxy is clear that this figures will be worst.

There are several questions

1. amount of delay added by the proxy:
does anybody have idea of something like a multiplier factor, i.e.: times in testcafe will be -> X times the DOMContentLoaded you get from the developer console.

2. When to get Selector value from the page

I'm trying to do this:
S1 - access the page PageUnderTest
S2 - set filter values
S3 - click search to submit the page and apply the filters
S4 - the PageUnderTest is rendered with the filters applied.

Because I'm trying to get the time till the page is loaded, I get BEGIN Timestamp before issuing t.click(button) (S3) then I expect for the page title, but not knowing how testcafe works I fear that testcafe get this value from S3 because the PageUnderTest is already rendered. Can anybody provide some clarifications?

I've a token that is changed on each submit then I'm getting the token in S3 (before the click) and loop reading the token till the value is different to the value got in S3. Do you think this is a good approach?

3- How to understand page has been fully rendered.
Do you have any suggestions?

Best regards

fman
  • 175
  • 2
  • 4

2 Answers2

1

TestCafe is a tool built for functional testing, supporting you to write end-to-end tests which should replicate real user scenarios within your web application. Do not use it to perform non-functional testing (like performance or load testing). Such tests would not yield any conclusive results. You can read more about TestCafe's scope here

Martin H.
  • 538
  • 1
  • 7
  • 21
  • Thanks Martin, I do not need exact client performance measurements just something that can be compared (and adjusted) to dev console times. My search for tools to do this measurements has been frutiless. This can be considered a poor's man approach. Do you have any tool suggestions? – fman Apr 01 '21 at 07:36
  • I have not tried it out yet, but I know that JMeter is quite popular in the area of performance and load testing. It's open source tooling from Apache, based 100% on Java so that portability for any OS is given. You might take a deeper look at it [here](https://jmeter.apache.org/). – Martin H. Apr 01 '21 at 08:27
  • Thanks for the tip, we have considered JMETER , but the site explains that it does not work as a Browser do. And doing all operation I need to do to access the features, with JMETER is too complex – fman Apr 01 '21 at 09:31
0

Try artillery for load testing or performance testing.

Also, if you want to measure the time it takes for an UI element to appear, you can build a counter, but those results will not be very accurate.

I used testcafe to do this:

  • Start a timer & click button X
  • Stop the timer when element Y appeared.

I wanted to see how long it takes for an UI element to appear, but this was not a valid test, because the UI wasn't slow, the API behind it was slow, that is when I gave Artillery a try.

I use Artillery + Testcafe for my tests. I'm a QA so I don't really know others.

Liviu Avram
  • 103
  • 10