Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to performance test an AngularJS Web Application?

I used to do performance testing on websites mostly with JMeter scripts.

However, more and more projects are build with frontend MVC's, such as AngularJS and a current project is loading all of it's content via angular view files, REST calls etc. Unfortunately, JMeter doesn't execute any javascript thus my load test return me the homepage in just (400ms). In real, it actually takes several seconds to load in a browser. When I check the response data, it does not contain any data yet due to Angular.

Instead of investigating the network traffic and individually loading each component (e.g. profile.html, notification.html, REST calls etc. ). Is there a product on the market or some best case I could follow that is similar to executing JMeter scripts, but considering javascript execution and loading of external resources due to javascript?

(I am not planning to profile javascript execution times. This is still to test if the infrastructure behind is capable serving xyz simultaneous users)

like image 825
jens Avatar asked Jan 29 '15 16:01

jens


People also ask

Does JMeter support AngularJS?

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.

Can JMeter test Web application?

JMeter is a free open-source tool used for analyzing and measuring the performance of applications, different software services, and websites. Written entirely in Java, JMeter can be used to conduct performance, load, and functional testing of many different web applications and server protocols.


1 Answers

Although JMeter isn't capable of executing client-side JavaScript it can record relevant requests via HTTP(S) Test Script Recorder. Once recorded you should be able to combine all the standalone requests into one "aggregate" using JMeter's Transaction Controller

If this easy approach for some reasons doesn't play for you check out How to Load Test AJAX/XHR Enabled Sites With JMeter for more options and clues.

like image 99
Dmitri T Avatar answered Nov 11 '22 05:11

Dmitri T