DriversRecommendedOutdated drivers can make a good PC feel brokenScan driver issues before chasing fixes manually.Scan NowOctober DealsAmazon USOctober deal check: compare before you payAmazon US: current deals, useful picks and tech finds.Check DealsSlow PC?RecommendedPC slow today? Run a repair scan before it gets worseResolve common Windows issues and optimize system performance.Scan Now×
Skip to content
World desk5 min

What’s Deprecated or Removed in Selenium 4?

Selenium 4 changes vary by binding and release. Learn which Java, C#, and Python APIs were removed or deprecated and what to use instead.
Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

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.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Java: replace the old locator helpers

The Java findElementBy* and findElementsBy* helpers were removed. Use the generic locator methods with a By strategy instead.

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.

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.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Java: update browser identity and Firefox configuration

  • Browser identity: use Browser.FIREFOX instead of the deprecated BrowserType.FIREFOX.
  • Firefox legacy option: setLegacy(true) is deprecated; the upgrade guidance recommends GeckoDriver instead.
  • Options merging: merge returns 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:

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.

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.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

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:

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.Support on Ko-Fi

How to choose the right migration for your project

  1. 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.
  2. Search your test code for the affected call or argument. Prioritize removed methods and constructor arguments because they will fail rather than merely warn.
  3. Apply the binding-specific replacement. Use the examples above for Java, C#, or Python, and confirm signatures for your installed version.
  4. Review capabilities and remote-grid settings separately. Standardize names according to W3C conventions and consult your provider for vendor-specific options.
  5. 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.
  6. 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.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Troubleshooting migration errors

  • “Cannot resolve method” or missing attribute for findElementBy*: replace the removed helper with findElement(By...) in Java or find_element(By..., ...) in Python.
  • Python rejects executable_path or desired_capabilities: this commonly indicates code using arguments removed in 4.10. Move driver setup to service= and options=.
  • 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.

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.

Leave a Reply

Your email address will not be published. Required fields are marked *

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

More from the Wire

  1. World desk4 min
    How to Spot an AI Voice Scam Before Sending MoneyDon’t rely on how a caller sounds. Pause, call back through a known number, and verify the emergency with another trusted person before sending money.
  2. Mountain View desk4 min
    Google’s SynthID Detector: How to Check AI-Generated Images, Video and AudioGoogle’s SynthID Detector looks for an embedded watermark in supported images, video and audio. Here is what its results do—and do not—show.
  3. Redmond desk20 min
    How to create a link to File or Folder in Windows 11Windows 11 gives you several ways to point to a file or folder without moving or duplicating it. You can create a desktop shortcut,…
Recommended PC Tool
Recommended PC Tool
Crashes, No Sound, or Screen Glitches?Free driver scan
PC Slower Than It Used to Be?Free scan - under a minute

Two free Windows tools

One Free Minute Could Fix That PC

Before you go - each of these free tools takes about a minute and tackles what quietly slows a Windows PC down.

Special offer. View Outbyte info, uninstall instructions, EULA, and Privacy Policy.