PROVIDER Β· the historical standard of browser automation
Selenium
Selenium pioneered browser automation and implements the W3C WebDriver standard where multi-language bindings and Grid keep it irreplaceable for enterprise estates and large parallel runs, while new projects shift to Playwright.
Pros
Cons
Product Information
Detailed Notes
Overview
Selenium was created by Jason Huggins in 2004 as the pioneer of browser automation, and Selenium 4 centres on the W3C WebDriver standard with Java, Python, C#, Ruby, and JavaScript bindings plus Grid distributed execution.
For Programming Languages & Frameworks work the value is ecosystem breadth and language freedom, since Java teams use Selenium with TestNG and Python teams with pytest, Grid supports large parallel and cross-machine distribution, and enterprise automation estates and platforms largely build on it.
See the current state, because no auto-waiting means explicit waits and prominent flakiness, debugging and tracing trail Playwright, browser drivers must match versions though Selenium Manager eases this, and new projects shift to Playwright leaving Selenium mainly for maintenance.
Core Strengths
- The W3C WebDriver standard with the broadest browser and platform support
- Complete bindings for Java, Python, C#, Ruby, and JavaScript
- Grid for large-scale parallel and distributed runs
- The deepest enterprise platform and ecosystem base
Product Ecosystem
Core protocol
The W3C WebDriver protocol with element locating, actions, and explicit waits.
Bindings
Official Java, Python, C#, Ruby, JavaScript, and Kotlin bindings.
Distribution and tools
Selenium Grid, Selenium Manager for drivers, and the page object model.
Drawbacks
- No auto-waiting causing prominent flakiness
- Weaker debugging and tracing than Playwright
- Browser driver version management still matters
- Declining new-project adoption with community focus shifting
Use Cases
- Existing enterprise automation (β β β β β ) - Deepest ecosystem base
- Multi-language teams (β β β β ) - Complete bindings
- Large distributed execution (β β β β ) - Mature Grid
- New E2E projects (β β ) - Choose Playwright
Pricing
| Plan | Price | Scope |
|---|---|---|
| Selenium and bindings | $0 | Apache 2.0, free |
| Selenium Grid | $0 | Free with server costs |
| Cloud testing platforms | Usage billing | BrowserStack, Sauce Labs |
The framework is free with Grid costing only servers, where the real cost is stability work since no auto-waiting means designing explicit waits per case, often doubling maintenance effort versus Playwright.
FAQ
-
Is Selenium still worth using? Yes for existing estates and edge cases other tools miss, while new projects favour Playwright.
-
What improved in Selenium 4? W3C alignment, relative locators, Selenium Manager driver handling, and Grid distributed tracing.
-
Why are tests flaky? Missing auto-wait acts before elements are ready, improved markedly by explicit waits and page objects.
Code Examples
Explicit wait for elements
from selenium import webdriver
from selenium.webdriver.common.by import By
from selenium.webdriver.support.ui import WebDriverWait
from selenium.webdriver.support import expected_conditions as EC
driver = webdriver.Chrome()
try:
driver.get("https://example.com/plans")
cards = WebDriverWait(driver, 10).until(
EC.presence_of_all_elements_located((By.CSS_SELECTOR, "[data-testid='plan-card']"))
)
print("card count:", len(cards))
finally:
driver.quit()
Selenium has no auto waiting so WebDriverWait with expected conditions is the key to stability.
Remote execution with Grid
from selenium import webdriver
from selenium.webdriver.chrome.options import Options
options = Options()
driver = webdriver.Remote(command_executor="http://grid.example.com:4444", options=options)
driver.get("https://example.com")
Community & Resources
Communities and official channels
- Selenium Site β Docs, downloads, and Grid
- GitHub SeleniumHQ/selenium β Source, issues, and releases
- Stack Overflow #selenium β Locator and wait answers
Learning resources and tools
- Selenium Docs β The full WebDriver reference
- Waiting Guide β Explicit versus implicit waits
- Page Object Model β The recommended test structure