Glossary
Selenium: browser automation through WebDriver
Selenium is an open source project for driving real browsers from code, built around the W3C WebDriver standard and available in many programming languages.
What Selenium consists of
Selenium is a family of tools rather than one library. WebDriver is the core: language bindings send commands over a standard protocol to a driver (chromedriver, geckodriver, safaridriver), which controls the browser. Selenium IDE is a browser extension that records and replays clicks. Selenium Grid spreads sessions across many machines (see Selenium Grid). Recent versions include Selenium Manager, which fetches a matching driver for you, removing a classic source of version errors.
Languages
Official bindings exist for Java, Python, C#, JavaScript and Ruby, and community bindings cover others. Because WebDriver is a W3C standard, the same concepts (sessions, elements, waits) carry across languages, which is one reason Selenium remains common in QA teams with mixed stacks.
Waiting correctly
Most flaky Selenium scripts fail on timing. A page loads, a script adds an element a moment later, and the test looks for it too early. Use explicit waits for the condition you need rather than fixed sleeps.
from selenium import webdriver
from selenium.webdriver.support.ui import WebDriverWait
from selenium.webdriver.support import expected_conditions as EC
drv = webdriver.Chrome()
drv.get("https://example.com/contact")
box = WebDriverWait(drv, 15).until(
EC.presence_of_element_located(("css selector", "[data-sitekey]")))
key_on_page = box.get_attribute("data-sitekey")
print("widget key", key_on_page)
How sites notice Selenium
A WebDriver controlled browser sets navigator.webdriver to true, as the standard requires. Detection scripts also look at driver specific variables, plugin and language lists, and behavior such as instant typing. Patches and modified drivers exist to hide some of these, but they are an arms race. For legitimate testing of your own site, the simpler answer is test keys: Google publishes reCAPTCHA test keys that always pass, and Cloudflare offers Turnstile test site keys, so your staging environment never needs a real solve. Check the current keys in their documentation.
Adding a solving step
When you automate a third party page you are allowed to use, such as a public form in an accessibility workflow, treat the CAPTCHA as one more step. Read the site key as shown above, send it with the page URL to GateSolver, poll until the token is ready, then place it in the hidden field.
drv.execute_script(
"document.getElementById('g-recaptcha-response').innerHTML = arguments[0];",
token_from_api)
drv.find_element("css selector", "form button[type=submit]").click()
Some sites read the token through a JavaScript callback instead of the field; in that case call the callback with the token. A reCAPTCHA v2 task usually returns under 9 seconds, and only solved tasks are billed. The Selenium integration guide walks through full examples.
Running it unattended
In CI or on a server, run the browser headless, set a fixed window size so layouts do not shift between runs, and always quit the driver in a finally block. Leaked browser processes pile up quickly on a busy machine and are a common reason a scraping host slowly runs out of memory.
Selenium compared with newer tools
Newer libraries such as Playwright offer automatic waiting and browser contexts out of the box. Selenium's strengths are the standard protocol, broad language support, real browser coverage including Safari, and a large body of existing test suites.
Common questions
Which languages does Selenium support?
Official bindings cover Java, Python, C#, JavaScript and Ruby, with community bindings for several other languages.
Do I still need to download chromedriver myself?
Usually not. Selenium Manager in recent versions finds or downloads a matching driver automatically.
Why does a site know my browser is controlled by Selenium?
WebDriver sets navigator.webdriver to true and leaves other traces that detection scripts check.
How do I test my own forms that use reCAPTCHA?
Use the test keys Google publishes for staging, which always pass, so tests never depend on a real solve.
Where does the solved token go in Selenium?
Into the g-recaptcha-response field via a script, or into the site callback if the page uses one.
Keep reading
- SeleniumThe reference Selenium setup in Python and Java: explicit waits, reCAPTCHA v2 and Turnstile tokens, callbacks, retries and Grid scaling.
- Selenium GridThe Selenium component that routes many browser sessions to a pool of nodes, so tests and jobs run in parallel across machines.
- Web scraping with Selenium and PythonSelenium scraping that stays stable: explicit waits, locators that survive redesigns, headless Chrome, infinite scroll and stale elements.
- navigator.webdriverThe standard flag that reports automation control, what switches it on, and why overriding it alone fixes little.