What is the role of Selenium in load testing a webpage if it cannot generate 200 or 300 requests? I understand, the client side automation can be done. But how do I test my web application for a real environment for 1000 or 2000 concurrent users.
How do I basically do it ?
Selenium runs actual web browsers for automated testing of web sites. Most authentic user experience test short of a person actually looking at it, great for testing features. But consider the resource use of your favorite web browser, that is quite heavy.
Replaying HTTP on the wire can be much faster. Load testing tools are user-agent without the browser. Ideally captured from your real application traffic, and replayed at high speed.
Find a load testing tool you like. Fortunately HTTP is ubiquitous, so this may already exist. For example, The Grinder, Gatling, GoReplay, JMeter, Locust, Tsung. The intent to use these for load testing is apparent in their UI: requests per second is prominent.
As per Selenium documentation:
There are basically 2 constraints:
There are some metrics and KPIs including but not limited to:
Resource consumption, i.e. Firefox 95 needs 1 CPU and 2 GB of RAM per instance so for 1000 users you will need 1001 CPUs and 2 Terabyte of RAM
Selenium limitations in terms of number of nodes in Grid (there is no official strict limit, however in case of hundreds of browsers I expect some certain issues with regards to throughput)
So I would recommend re-considering your approach and use a dedicated load testing tool for this