ScriptsApr 12, 2026·1 min read

Selenium — Browser Automation Framework and Ecosystem

Selenium is the original browser automation framework for testing web applications. WebDriver API supports Chrome, Firefox, Safari, Edge across Java, Python, C#, Ruby, JavaScript. The industry standard for E2E web testing since 2004.

SC
Script Depot · Community
Quick Use

Use it first, then decide how deep to go

This block should tell both the user and the agent what to copy, install, and apply first.

pip install selenium
# Download ChromeDriver or use webdriver-manager
pip install webdriver-manager
from selenium import webdriver
from selenium.webdriver.common.by import By
from selenium.webdriver.chrome.service import Service
from webdriver_manager.chrome import ChromeDriverManager

driver = webdriver.Chrome(service=Service(ChromeDriverManager().install()))
driver.get("https://tokrepo.com")

# Find and interact
search = driver.find_element(By.CSS_SELECTOR, "input[type=search]")
search.send_keys("react")
search.submit()

# Assert
assert "React" in driver.page_source

driver.quit()
Intro

Selenium is the original browser automation framework for web application testing. Created by Jason Huggins at ThoughtWorks in 2004. The WebDriver API became a W3C standard and is implemented by every major browser vendor. Supports Chrome, Firefox, Safari, Edge across Java, Python, C#, Ruby, and JavaScript.

What Selenium Does

  • WebDriver — W3C standard browser control protocol
  • Cross-browser — Chrome, Firefox, Safari, Edge
  • Multi-language — Java, Python, C#, Ruby, JS
  • Selenium Grid — distributed parallel testing
  • Selenium IDE — record and playback browser extension
  • Wait strategies — explicit and implicit waits
  • Actions API — mouse, keyboard, drag-drop
  • Screenshots — capture on failure

Comparison

Tool Protocol Cross-browser Multi-lang
Selenium WebDriver (W3C) All 5
Playwright CDP/WebDriver 3 4
Cypress In-browser 4 JS only
Puppeteer CDP Chromium JS/Python

常见问题 FAQ

Q: Selenium vs Playwright? A: Playwright 更现代(auto-wait、更好的 DX),Selenium 更成熟、更多语言、W3C 标准。遗留项目或 Ruby/C# 多选 Selenium,新项目多选 Playwright。

来源与致谢 Sources

Discussion

Sign in to join the discussion.
No comments yet. Be the first to share your thoughts.

Related Assets