Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to test performance / load of a modern angular application

I want to load / performance test a web application which uses angular 6+ as the frontend-framework. The application is quite big and uses lots of wizards / modals etc. I want to do some "real" e2e-frontend-tests (not just testing API-calls, but also js-rendering etc.)

What are the current state-of-the-art approaches and tools to test applications like this?

To clearify, i want to do some real e2e performance tests like e.g. open a browser in headless mode, open a wizard and get the time it takes until the wizard appears. Like frontend testing with selenium. I could do this with selenium too but i don't know if its the right tool.

like image 484
Tobias von Falkenhayn Avatar asked Jan 28 '19 16:01

Tobias von Falkenhayn


People also ask

Which loading helps the performance of angular application?

1. Lazy Loading module. The perfect plot for releasing the complexity of routers and components is lazy loading. It allows you to separate a large chunk file into many files and load JavaScript components only when the relevant router is triggered, avoiding the hassle of dealing with Chunk files.

How do I test my angular application?

If Angular CLI is used to manage the Angular projects, it will automatically support Jasmine and Karma Configurations. All you need in order to test your application is to type the command ng test.

Can we test angular application with JMeter?

With regards to Angular JS specifics, 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.


1 Answers

The best way of testing client-side performance is profiling the application using browser developer tools

If you want to automate the process - you should go for the browser automation framework, the most popular one is Selenium. You will be also capable of executing JavaScript calls to access Performance object in general and Navigation Timing / User Timing APIs in particular.

I would also recommend keeping in mind server-side performance, i.e. you might want to check how many concurrent users you application can handle without issues, what are the saturation point / first bottleneck, when response time starts increasing or errors start occurring. So consider combining client-side performance tests with conducting the anticipated load onto your application as it can be the case that from client perspective rendering is very fast but server responds slowly causing bad user experience. Depending on your test lab hardware you can either go for Selenium Grid to kick off many browser instances or go for a dedicated load testing tool

like image 162
Dmitri T Avatar answered Oct 31 '22 10:10

Dmitri T