There is no single list of everything deprecated across every Selenium 4 language binding and release. The practical answer depends on your language and target 4.x version: some APIs were deprecated, others were removed in later releases, and some changes reflect Selenium 4’s move to the W3C WebDriver standard. The examples below cover major migration points, not every API in every binding.
Deprecated and removed are different
A deprecated API remains available in the relevant context but is marked for replacement; a removed API is no longer available there. Don’t assume every change happened in Selenium 4.0.0: for example, Python’s locator helpers were removed in 4.3, while two constructor arguments were removed in 4.10.
As an Amazon Associate I earn from qualifying purchases.
Selenium 4 adopted the W3C WebDriver standard and removed support for the legacy protocol. The Selenium project said most users should not notice an effect, with capabilities and Actions among the notable exceptions. Code that depends on internals or APIs already marked deprecated may need changes when upgraded.
Java: replace the old locator helpers
The Java findElementBy* and findElementsBy* helpers were removed. Use the generic locator methods with a By strategy instead.
#1 Best Overall
| Old call | Replacement |
|---|---|
driver.findElementById("elementId") |
driver.findElement(By.id("elementId")) |
driver.findElementsByCssSelector(".item") |
driver.findElements(By.cssSelector(".item")) |
Use the matching By method for your locator: className, cssSelector, id, linkText, name, partialLinkText, tagName, or xpath. The complete Java example is:
import org.openqa.selenium.By;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.WebElement;
WebElement element = driver.findElement(By.id("elementId"));
var elements = driver.findElements(By.cssSelector(".item"));
Java: use Duration for timeouts and waits
The upgrade guidance replaces timeout and wait arguments expressed as a number plus TimeUnit with java.time.Duration. This applies to calls such as implicit waits, WebDriverWait, and FluentWait.withTimeout and pollingEvery.
Rank #2
import java.time.Duration;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.support.ui.WebDriverWait;
// Set an implicit wait
driver.manage().timeouts().implicitlyWait(Duration.ofSeconds(10));
// Set an explicit wait
WebDriverWait wait = new WebDriverWait(driver, Duration.ofSeconds(10));
Use the Duration-accepting overloads for the wait APIs in your Selenium version. Confirm the exact signatures against the API documentation for the binding and version you are compiling against.
Java: update browser identity and Firefox configuration
- Browser identity: use
Browser.FIREFOXinstead of the deprecatedBrowserType.FIREFOX. - Firefox legacy option:
setLegacy(true)is deprecated; the upgrade guidance recommends GeckoDriver instead. - Options merging:
mergereturns a new options object. Assign its return value rather than assuming the existing object was modified.
C#: replace AddAdditionalCapability
In C#, AddAdditionalCapability is deprecated. Replace it with AddAdditionalOption. For example, a provider-specific options object can be added like this:
Rank #3
options.AddAdditionalOption("cloud:options", cloudOptions);
Selenium 4 capability handling follows W3C conventions. Standard capability names include browserName, browserVersion, platformName, acceptInsecureCerts, pageLoadStrategy, proxy, timeouts, and unhandledPromptBehavior. Nonstandard capabilities need a vendor prefix; check your browser or remote-grid provider’s current format before sending them.
Python: replace removed locator methods
Python’s find_element_by_* method family was removed in Selenium 4.3. Use find_element or find_elements with a locator strategy from By.
Rank #4
from selenium.webdriver.common.by import By
item = driver.find_element(By.ID, "x")
items = driver.find_elements(By.CSS_SELECTOR, ".item")
Choose the appropriate By strategy, such as By.CLASS_NAME, By.LINK_TEXT, By.NAME, By.PARTIAL_LINK_TEXT, By.TAG_NAME, or By.XPATH.
Recommended Free Tools
Python 4.10+: pass Service and Options objects
The executable_path and desired_capabilities driver-constructor keyword arguments were removed in Selenium 4.10. Pass a Service object using service= and browser configuration through options=. For Chrome, for example:
Best Value
from selenium import webdriver
from selenium.webdriver.chrome.service import Service
from selenium.webdriver.chrome.options import Options
options = Options()
service = Service("/path/to/chromedriver")
driver = webdriver.Chrome(service=service, options=options)
Use the corresponding service and options classes for another browser. Where it fits your setup, Selenium Manager can manage the driver instead of requiring a hard-coded executable path:
from selenium import webdriver
from selenium.webdriver.chrome.options import Options
options = Options()
driver = webdriver.Chrome(options=options)
Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.How to choose the right migration for your project
- Identify the binding and exact version. Check the dependency or package lockfile; “Selenium 4” alone is not enough to determine when a particular API changed.
- Search your test code for the affected call or argument. Prioritize removed methods and constructor arguments because they will fail rather than merely warn.
- Apply the binding-specific replacement. Use the examples above for Java, C#, or Python, and confirm signatures for your installed version.
- Review capabilities and remote-grid settings separately. Standardize names according to W3C conventions and consult your provider for vendor-specific options.
- Run the affected tests against the intended browser and grid. A local driver passing does not establish that a remote provider accepts the same capability format.
- Check the official upgrade guide, API docs, and release notes for your binding. The examples here are not an exhaustive inventory, especially for JavaScript and Ruby.
Or skip the browser setup
If your actual goal is to capture a clean image or PDF of a webpage—not to run browser interactions or assertions in a WebDriver test—ScreenshotNeo is a separate screenshot API and MCP server, not a Selenium replacement. One GET request returns an image or PDF:
curl -G "https://api.screenshotneo.com/v1/shot" -d access_key=YOUR_API_KEY --data-urlencode url=https://stripe.com -o shot.webp
See the ScreenshotNeo API documentation for request options. Cookie banners are accepted and removed before capture, along with more than 60 known consent platforms, newsletter popups, and chat widgets; each cleanup step can be turned off. Bot checks or CAPTCHAs, blank pages, timeouts, failed loads, and cache hits are not billed, and each response identifies the result with X-Page-Verdict and X-Billed headers. Its MCP server offers take_screenshot, get_page_info, and capture_pdf for AI agents and MCP clients. The free plan includes 1,000 shots a month without a card; paid plans start at $5 for 3,000 shots. Sign up for ScreenshotNeo’s free plan.
The Tool Desk
Outbyte PC Repair FREEClear out junk files and repair common Windows errorsFree Scan →Outbyte Driver Updater FREEFix the driver behind crashes, sound loss and screen glitchesFind Drivers →Troubleshooting migration errors
- “Cannot resolve method” or missing attribute for
findElementBy*: replace the removed helper withfindElement(By...)in Java orfind_element(By..., ...)in Python. - Python rejects
executable_pathordesired_capabilities: this commonly indicates code using arguments removed in 4.10. Move driver setup toservice=andoptions=. - A capability is rejected by a grid: check that standard names follow W3C conventions and that nonstandard options use the provider’s required vendor prefix and structure.
- A timeout call no longer matches an overload: use the
Duration-based API for the Java Selenium version in use. - An options change appears not to take effect after
merge: assign the returned merged object and pass that object to driver setup. - A browser-specific legacy setting no longer works: for Firefox, replace deprecated
setLegacy(true)usage with the GeckoDriver approach documented for your version.
Version scope and other bindings
Selenium 4.0.0 was announced on October 13, 2021. Not all later removals were part of that initial release: the Python changes above have specific 4.3 and 4.10 boundaries. JavaScript and Ruby have their own upgrade guidance, and the same examples should not be treated as a complete cross-binding list.
The Selenium downloads page is dynamic. At the time of the supplied release information, it listed stable 4.49.0 for Java, .NET/C#, and Ruby, dated September 9, 2026. Check the live listing and the relevant binding’s current API documentation and release notes before using a version number or API status as a compatibility guarantee.
Quick Recap
Product prices and availability are accurate as of the date/time indicated and are subject to change. Any price and availability information displayed on Amazon at the time of purchase will apply.




