Go back to all articles

JMeter vs Selenium: Which One Can Load Test Your Web App

Comparison
13 min read
Denis Sautin

Denis Sautin

Author

Denis Sautin

Denis Sautin is an experienced Product Marketing Specialist at PFLB. He focuses on understanding customer needs to ensure PFLB’s offerings resonate with you. Denis closely collaborates with product, engineering, and sales teams to provide you with the best experience through content, our solutions, and your personal journey on our website.

Full Bio

Product Marketing Specialist

Reviewed by Boris Seleznev

boris author

Reviewed by

Boris Seleznev

Boris Seleznev is a seasoned performance engineer with over 10 years of experience in the field. Throughout his career, he has successfully delivered more than 200 load testing projects, both as an engineer and in managerial roles. Currently, Boris serves as the Professional Services Director at PFLB, where he leads a team of 150 skilled performance engineers.

Full Bio

At a glance

  • The short answer. Selenium automates a real browser, one browser per simulated user, so a Selenium load test runs out of CPU long before it reaches realistic traffic. The Selenium project itself advises against using WebDriver for performance testing. Apache JMeter works at the protocol level: its threads send HTTP requests without starting a browser, so one machine can run many more virtual users, and several machines can run one test together. For load, use JMeter or another protocol-level tool. Keep Selenium for functional checks, and if you need browser timings under load, run a handful of browser users next to the protocol test.
  • Who this is for. Teams that already have Selenium scripts for a web application and want to know whether those scripts can carry a load test, or what to build instead.
  • How we checked. Facts about Selenium come from the Selenium documentation, facts about JMeter from the Apache JMeter website and user manual, and facts about the WebDriver Sampler from the plugin's own documentation, all read on 22 November 2026, with links in the text. Where a source did not confirm something, we left it out. We did not benchmark either tool.
  • Who wrote this. PFLB makes a cloud load testing platform and sells performance testing services. Since 2008, our 150+ performance engineers have tested systems for 300+ companies.

JMeter vs Selenium: Comparison Table

SeleniumApache JMeter
Level it works atBrowser: WebDriver drives a real browser through the automation APIs that browser vendors provideProtocol: it sends requests the way a browser would, but does not render pages or run their JavaScript
Resource per virtual userOne real browser per user; the WebDriver plugin docs estimate about one CPU core per browser userA thread that sends requests, with no browser behind it
What it measuresWhat one user sees: page loads, clicks, client-side JavaScript and AJAX requests in the browserWhat the server does under load: response time, throughput and errors for each request
Distributed runSelenium Grid runs test suites in parallel on several machines to finish them sooner and cover more browsersOne JMeter client controls remote JMeter engines; each engine runs the full test plan
ReportsThe Selenium docs point to performance testing tools for reporting and analysisHTML dashboard with percentiles, throughput and errors, generated at the end of a test or later from the results file
When to useFunctional UI tests and client-side timing for a few usersLoad, stress and volume testing of the server side

The table comes down to one fact. A browser per virtual user is expensive, and the server cannot tell a browser from JMeter as long as the requests match. The sections below explain where each tool stops.

Why Selenium Load Testing Hits a Wall

Selenium is a family of software tools for browser automation. The part you use in tests is WebDriver, which controls the browser through the vendor's automation API, as if a real user were operating it. That makes a Selenium script good at checking the user interface: it clicks the same buttons and waits for the same elements your customers do.

The cost shows up as soon as you add users. Each simulated user needs its own browser, and the WebDriver Sampler documentation puts the footprint at roughly one CPU core per virtual user, which it says makes hundreds or thousands of browser users hard to reach. Its tutorial gives a rule of thumb for one machine: the number of browsers should be at most the number of cores minus one, so a 4-core host runs 3 browser users.

The Selenium docs add a second problem. Their page on performance testing lists it among discouraged practices: WebDriver is not optimized for the job, and timings vary with browser startup, third-party servers that host scripts and styles, and the overhead of WebDriver itself. You cannot tell how much of a slow result comes from your site and how much from the test harness. To find performance bottlenecks, you need timings for each resource, separated from the noise of the test setup, and the docs say dedicated performance testing tools already give you that. The same page points out that functional and performance tests pull in opposite directions, and it names JMeter as an open source package built for performance testing.

A Selenium script can still tell you something under load: how long a page takes to become usable for one user while the servers are busy. To make them busy, you need a protocol-level tool.

How JMeter Generates Load at the Protocol Level

The Apache JMeter website states the design in one line: JMeter is a protocol-level tool and not a browser. To a web server it looks like many browsers at once, yet it skips the browser's work. It does not run the JavaScript in your HTML pages, and it does not render them. If you want the images, scripts and style sheets that a page references, the HTTP Request sampler can parse the HTML and fetch those embedded resources too.

That is why one machine goes further with JMeter, a tool built to put load on a system and measure performance on the server side. A test plan has thread groups, and each thread is a virtual user running HTTP requests with timers, extractors and assertions. Beyond HTTP and HTTPS, JMeter tests SOAP and REST web services, FTP, databases over JDBC, LDAP, JMS, mail protocols, TCP, native commands and Java objects. You build and debug the plan in the GUI, then run the real test in CLI mode, which the best practices page recommends together with as few listeners as possible.

When one machine cannot generate enough load, remote testing lets one JMeter client control many JMeter engines and collect their results. JMeter does not split the threads between engines: each one runs the whole plan, so 1,000 threads on 6 engines means 6,000 threads against your servers. All nodes need the same configuration: the same JMeter and Java versions, and data files such as CSVs must already sit on each engine.

After the run, the HTML dashboard turns the results file into a report with a statistics table per transaction, response time percentiles (90th, 95th and 99th by default), throughput and errors. You can generate it at the end of the test or later from the CSV.

Selenium Grid: Parallel Test Runs on Many Machines

Selenium Grid is the usual answer when someone asks how to scale Selenium. Its documentation describes a different goal: Grid sends WebDriver commands to browsers on remote machines (nodes) to speed up a test suite and run it on more browser versions and operating systems. The docs show the math in test execution time, for example 15 tests of 45 seconds taking 11 minutes 15 seconds on one node and 45 seconds on 15 nodes.

Grid helps when you run many different tests at the same time. It does not change the cost of each browser, so 500 concurrent users on Grid still means 500 browsers on your nodes. The Remote Driver Config of the WebDriver plugin says the same thing from the JMeter side: three concurrent users start three browser instances on the Grid node.

Selenium Performance Testing in JMeter: The WebDriver Sampler

To run Selenium from JMeter, you add the WebDriver Sampler, a plugin from JMeter-Plugins.org that runs Selenium WebDriver inside a JMeter thread. It supports Chrome, Edge, Firefox, Internet Explorer and HtmlUnit locally, and remote browsers through a Selenium Grid.

The sampler gives you an empty script field and a WDS object, and leaves the rest to you:

  • you start and stop the timer with WDS.sampleResult.sampleStart() and WDS.sampleResult.sampleEnd();
  • you drive the browser through WDS.browser, the standard WebDriver API;
  • you validate the result yourself, because the sampler counts a sample as successful unless your script marks it as failed.

The results then appear in JMeter listeners and reports like any other sample.

The tutorial is open about the limits. Each thread holds one browser, each browser takes significant resources, and the plugin is meant to complement JMeter's HTTP samplers. Its intended use is a test where HTTP samplers produce a production-like load on the server while the WebDriver samplers measure what a real user experiences at the same time: JavaScript execution, CSS transforms, third-party plugins and AJAX requests that protocol-level samplers never see.

Parts of the plugin documentation are old: some examples still target Java 6 and 7, and the page of best practices is marked as deprecated.

JMeter or Selenium: Choose by Scenario

  • You need to know how many concurrent users the system handles. Use a protocol-level test in JMeter. Selenium would spend your hardware on browsers, and Selenium's own docs say the timings will be noisy.
  • You need to know what users see while the system is busy. Run the protocol test for the load and add a few browser users for timing in the user interface. Keep browser threads on each machine below its core count; the plugin tutorial advises cores minus one.
  • Your page does most of its work in the browser. Client-side rendering and heavy JavaScript do not appear in JMeter samples, because JMeter does not execute them. Measure them with a small browser test, and load the APIs behind the page with the protocol test.
  • You only have Selenium scripts and no time to write a load test. Do not scale the Selenium suite. Record the same journey in the browser as a HAR file and turn it into a protocol-level test (see HAR file to JMeter script), then add correlation, test data and assertions.
  • You test APIs rather than pages. Selenium has no role here. Compare JMeter with an API tool instead, as in JMeter vs Postman.

Combine Them: A Few Browser Users on Top of Protocol Load

The pattern that works is the one the WebDriver plugin describes: most virtual users run at the protocol level, and a few run a real browser. Other load testing tools document the same idea. The k6 browser docs call it a hybrid approach: a small number of browser users next to a large number of protocol-level ones, so you can test real front-end flows while the backend carries the load, with less resource use than a full browser test. In k6, both run from one script through scenarios.

With JMeter, we suggest two test plans that run at the same time:

  1. A protocol test plan with HTTP samplers, built from a recorded journey, carrying the load you want to prove. It can run on several remote engines.
  2. A small test plan with WebDriver Samplers running the same journey in a browser, on a separate machine, with no more browser threads than that machine has cores minus one.
  3. Run both in CLI mode and compare the server-side percentiles in the dashboard with the browser timings of the small plan.

Keep the two plans apart because remote engines each run the full plan they receive: a browser thread group inside the protocol plan would start browsers on every engine and take CPU from the HTTP threads.

Running the Recorded Journey as a Protocol Test on PFLB Platform

If you would rather not keep load machines of your own, PFLB Platform runs the protocol part of this setup from cloud load generators. Record the journey in Chrome DevTools, save it as a HAR file and import it into a new test: you filter the hosts and static resources, and the platform adds the use cases, transactions and requests. If you already turned the HAR file into a JMeter script, the platform imports the .jmx file instead. You then add extractors for dynamic values, CSV parameters, assertions and an SLA, for example on average response time, the error rate or the 95th percentile, choose a stable or scalability load profile, watch the run in Grafana dashboards and can generate an AI report for a run. The WebDriver Sampler is not on the platform's list of supported plugins, and the JMX import does not accept a script with an unsupported plugin, so upload only the protocol plan and keep your Selenium probe on your own machine. For a site-wide test, see the website load testing tool. If you need people more than a tool, our performance testing services team designs and runs the test for you.

Turn a Browser Journey Into a Load Test
Import a HAR file or a JMX script, set the load profile and SLA, and run it from the platform's cloud load generators.

JMeter vs Selenium: FAQ

Can Selenium be used for load testing?

It can open many browsers, but it is a poor load generator. Each virtual user needs a full browser, about one CPU core by the WebDriver plugin's estimate, and the Selenium docs advise against WebDriver for performance testing because the timings are noisy. Use a protocol-level tool for the load and Selenium for a few browser users.

Is JMeter better than Selenium?

They do different jobs. JMeter sends protocol-level requests and is built for load and performance testing. Selenium drives a real browser and is built for functional testing of the user interface.

Can JMeter run Selenium scripts?

Through the WebDriver Sampler plugin, yes: it runs WebDriver code inside a JMeter thread and reports timings as JMeter samples. Each thread still starts its own browser, so the plugin's docs recommend it for client-side timing next to HTTP samplers, not as the source of load.

Can we do API testing with Selenium?

Selenium WebDriver controls a browser, so it tests an API only through the pages that call it. To test the API itself, send the requests with an HTTP tool such as JMeter or Postman.

Does Selenium Grid help with load testing?

Grid runs many tests in parallel across machines and browsers. Every concurrent user is still a browser on a Grid node, so the cost per user stays the same.

What are the 90th, 95th and 99th percentiles in a JMeter report?

They are the response times that 90%, 95% and 99% of the samples stayed under. The JMeter HTML dashboard shows these three by default in its statistics table, and you can change them in the report settings.

Choosing Between JMeter and Selenium

Start from the question you need answered. If it is "how many users can the system serve", build a protocol-level test from a recorded journey and run it in JMeter or on a platform that imports it. If it is "what does a user see at peak", keep a few Selenium browsers running next to that test. Scaling a Selenium suite to hundreds of browsers costs the most hardware and gives the least reliable numbers.

If you would rather have engineers design and run the test, tell us what you need to test.