Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to use Selenium to check for memory leaks in javascript app?

I am using java + selenium for automated testing of a javascript web-app. One question that has come up is memory leaks and how to test for them. Since I am already using selenium for testing the app, is there an easy way to get the memory usage and other profiling information for the web app? (leveraging selenium or/and other automated web-js testing tools)

Currently I'm using chromedriver but will be extending to use the firefox and ie drivers in the future.

like image 763
Joelle Boulet Avatar asked Oct 29 '13 19:10

Joelle Boulet


People also ask

Can you have memory leaks in JavaScript?

The JavaScript engine allocates memory when you create objects and variables in your application, and it is smart enough to clear out the memory when you no longer need the objects. Memory leaks are caused due to flaws in your logic, and they make way for poor performance in your application.

How do you test memory leaks in web application?

Start with metrics such as page load times, HTTP request times, and Core Web Vitals – time to the first byte, first contentful paint. If you use Sematext Experience you'll see a number of other useful metrics for your web applications and websites there. However, metrics themselves are only a part of the whole picture.

Can you test JavaScript with selenium?

Selenium is an open-source automation testing tool that supports a number of scripting languages like C#, Java, Perl, Ruby, JavaScript, etc. Depending on the application to be tested, one can choose the script accordingly.


1 Answers

Yeah, cant be done with selenium solely, take a look into tools like dynaTrace or httpWatch. Those can be integrated with webDriver. Also, take a look at this thread here.

like image 127
Erki M. Avatar answered Sep 27 '22 22:09

Erki M.