There will be instances where an organization’s software team might be working on developing a large web application by selenium for UI testing. It is also trying to figure out whether selenium can be used for load testing or not. There are views provided by experts supporting both in favor of and against selenium load testing. However, in this article, it has been shown that the selenium grid is considered to be a viable option for performing load testing.
The strategic role of Selenium in load testing:
Selenium Grid plays a unique and rare role in the software development and testing process. Selenium tests are parallelly executed on different browsers. Tests are being run on the master-slave model. Hence, the selenium grid can be used for load testing.
A load testing setup can be developed using Jenkins and Selenium Grid. Automation tasks can be executed by Jenkins, which is an open-source CI tool. Concurrent selenium tests can be run using multiple slave nodes. A selenium load testing job needs to be created using Jenkins along with a cluster of nodes so that parallel tests can be run.
In this setup, the selenium grid’s ability can be utilized so that tests can be offloaded across different nodes. A selenium plugin is available for Jenkins. To set up a test grid, a plugin is needed to eliminate manual hassles. If this kind of setup needs to be run then the right hardware needs to be procured.
The tactical usage of BrowserMob Proxy tool:
This is one of the popular tools that can be easily integrated with selenium testing. Performance stats are filtered and tracked for web applications. The traffic in HAR (HTTP Archive format) is archived and the whitelisting/blacklisting of the content is performed. Most of the HTTP tracking tools support HAR.
BrowserMob Proxy can be easily set up with a selenium standalone server for the purpose of carrying out load testing. Following are the steps that need to be followed for preparing the selenium load testing environment:
· Launch the latest version of BrowserMob Proxy
· A new project should be initiated while adding BrowserMob and Selenium Standalone server jars
· The execution should be initiated
· The proxy server starts and the logs are visible
· Post execution, the HAR file that contains performance logs needs to be checked
· A free HAR file analyzer could be used to verify the performance results.
The strategic use of Selenium scripts in load testing:
· Many real browsers can be run to create true load tests so that many concurrent users can be stimulated
· Load tests can be created for running a few real browsers that simulate a few concurrent users. Through this, user experience can be measured, while the massive load can be created with protocol-level scripts through which many concurrent users are simulated.
For the purpose of achieving browser-level testing, load tests can be executed by WebLOAD using Java Selenium scripts. There are quite a few ways to run Selenium with WebLOAD. The simplest one is where execution of java selenium scripts in WebLOAD takes place.
To achieve this, the script requires small additional changes to make it interact with WebLOAD. This can be done without the original functionality being broken. The execution of the enhanced script can be done in a regular test automation environment, where the additional changes are being ignored.
The strategic relevance of WebLoadDriver:
Browsers are controlled by Selenium WebDriver, which are an open-source collection of APIs. The browser’s own engine is used by Selenium WebDriver to control it. Selenium WebDriver is wrapped by WebLoadDriver that helps in implementing Selenium WebDriver methods and thus enriches it with load and performance testing functionality.
Leave a Reply