fman
fman

Reputation: 175

How to get some Browser performance indication using testcafe

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

Upvotes: 0

Views: 292

Answers (2)

Liviu Avram
Liviu Avram

Reputation: 103

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.

Upvotes: 0

Martin H.
Martin H.

Reputation: 584

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

Upvotes: 1

Related Questions