# 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. ## Install Save as a script file and run: ## Quick Use ```bash pip install selenium # Download ChromeDriver or use webdriver-manager pip install webdriver-manager ``` ```python 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. - **Repo**: https://github.com/SeleniumHQ/selenium - **Stars**: 34K+ - **Language**: Java (core) - **License**: Apache 2.0 ## 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 - Docs: https://www.selenium.dev/documentation - GitHub: https://github.com/SeleniumHQ/selenium - License: Apache 2.0 --- Source: https://tokrepo.com/en/workflows/42404d19-364b-11f1-9bc6-00163e2b0d79 Author: Script Depot