Selenium exceptions point to different failure layers: page timing, locator syntax, a changed DOM or browsing context, an obstructed element, or browser and driver setup. Diagnose the layer first; increasing timeouts or retrying blindly can hide the cause. This guide covers the common exceptions described in Selenium’s troubleshooting documentation and, where noted, Python exception classes in Selenium 4.50.0. Selenium does not define a cross-language canonical list of exactly 49 exceptions, and exception inventories differ by language binding and version.
Start by identifying the failure layer
Before changing a selector or adding a retry, check what Selenium was trying to do and what had happened immediately beforehand. Selenium’s Troubleshooting Assistance says, “The most common Selenium-related error is a result of poor synchronization.” That is a qualitative statement, not a measured error rate.
- State and timing: Had navigation and rendering reached the state your test needs? Relevant to missing elements and timeouts.
- Locator correctness: Does the selector match the live DOM, and does its syntax match the locator strategy?
- DOM lifecycle and context: Was the node replaced, did navigation occur, or did the script switch frames or windows?
- Visibility and hit testing: Is the intended element usable and unobstructed where Selenium will interact with it?
- Session and environment: Is the WebDriver session still alive, and can the browser and driver start in this environment?
For a problem caused by a browser driver, reproducing it in another browser can help determine whether the cause is driver-specific.
Locator and page-state exceptions
NoSuchElementException
Selenium could not find the element when it searched. A wrong page or failed preceding action, a locator that no longer matches, and a search made before the element appeared are all plausible causes. The exception alone does not tell you which one occurred.
Outdated Drivers Are Slowing You Down
One free scan finds every outdated or missing driver and matches the right update for your exact hardware.Free scan · exact hardware matchPC Slower Than It Used to Be?
A free scan shows the junk files, broken settings and background clutter dragging Windows down - then fixes them in one click.Free scan · Windows 10 & 11#1 Best Overall
- Read Before You Buy — No Video Output: These adapters support charging and USB 2.0 data transfer, but cannot transmit video signals. Except for standard USB webcams (which use USB data only), they are not compatible with HDMI/DisplayPort cables, video-capable USB-C hubs, or docking stations with video output.
- Convert USB-A Ports to USB-C: Designed to connect USB-C earphones, cables, flash drives, card readers, and other USB-C accessories to standard USB-A ports. Plug-and-play with no drivers or software required.
- Aluminum Alloy Housing: Built with a sturdy aluminum alloy shell that aids in heat dissipation and protects against daily wear and scratches. Designed to maintain a stable and secure connection.
- Compact & Travel-Friendly: The ultra-compact design allows the adapter to stay plugged into your device without blocking adjacent ports or adding bulk, reducing wear and tear on your original USB ports.
- 12-Month Warranty: Backed by a 12-month manufacturer warranty for peace of mind. Designed to meet strict quality control standards for reliable everyday performance.
- Verify: Confirm the current page and the result of the preceding navigation or action. Inspect the live DOM and check the locator strategy and selector against it.
- Fix: Correct the page flow or selector if either is wrong. If the element is expected to appear after rendering or an action, wait for the relevant condition rather than sleeping for an arbitrary duration.
The Python API reference also recommends checking the selector and using WebDriverWait when a page is still loading: selenium.common.exceptions, Selenium 4.50.0.
InvalidSelectorException
The selector is malformed or its syntax does not fit the chosen locator strategy. For example, XPath syntax supplied as CSS, or a CSS or XPath expression supplied as an ID, will not be interpreted as intended.
- Verify: Identify the strategy used by the locator call, then validate that the selector uses that strategy’s syntax.
- Fix: Correct the syntax or choose the matching strategy. Waiting longer cannot repair an invalid selector.
DOM lifecycle and browsing-context exceptions
StaleElementReferenceException
The stored element reference is no longer accessible. A refresh, navigation, dynamic DOM rebuild, or a switch to another window or frame can invalidate the reference or make it unavailable in the current context.
Rank #2
- 5-in-1 USB-C Hub: Experience comprehensive connectivity featuring a Power Delivery input, two USB-A 2.0 ports, a USB-A 3.0 port, and an HDMI port. (Note: The USB-C power delivery input port is only for connecting an external wall charger to power your laptop and cannot power peripheral devices.)
- 90W Pass-Through Charging: Achieve optimal charging with 90W pass-through power to your laptop, supported by a total input of 100W, with the hub reserving 10W for operational efficiency. (Note: Wall charger not included.)
- Quick Data Transfers: Accelerate your productivity with rapid data transfers using a high-speed 5Gbps USB 3.0 port and two 480Mbps USB 2.0 ports.
- 4K HDMI Display: Enhance your visual experience with a hub capable of delivering 4K resolution at 30Hz in both mirror and extend modes. Please note that this hub is compatible with MacBook (macOS 12 and newer), Windows 10 and 11, ChromeOS, and laptops equipped with DP Alt Mode and Power Delivery. Note: This device is not compatible with Linux.
- What You Get: Anker USB-C Hub (5-in-1, 4K HDMI), welcome guide, 18-month warranty, and our friendly customer service.
- Verify: Check whether navigation, a refresh, a rerender, or a window/frame switch occurred after the element was located.
- Fix: If the page rebuilt the node, locate it again in the current DOM. If the context changed, switch to the intended window or frame before using its element. If navigation replaced the page, return to the correct page and locate a fresh element.
Repeatedly retrying the same stale reference does not refresh it. The Python API reference documents this exception and context-related conditions at Selenium 4.50.0’s exception catalog.
What’s actually slowing this PC down?
Pick the symptom - the matching free tool is one click away.
DetachedShadowRootException and NoSuchShadowRootException
These Python API exception names concern shadow-root references, not ordinary element lookup. They are relevant when the code explicitly works with a shadow DOM root.
- Verify: Confirm that the target is inside a shadow tree, that the host and root still exist, and that the code is using the appropriate shadow-root context.
- Fix: If the DOM replaced the host or root, reacquire the current host and root. If the target is not in a shadow tree, use ordinary element lookup instead.
These names are listed in the Selenium Python 4.50.0 API reference; they should not be assumed to describe identical class inventories in other language bindings.
Rank #3
- Sleek 7-in-1 USB-C Hub: Features an HDMI port, two USB-A 3.0 ports, and a USB-C data port, each providing 5Gbps transfer speeds. It also includes a USB-C PD input port for charging up to 100W and dual SD and TF card slots, all in a compact design.
- Flawless 4K@60Hz Video with HDMI: Delivers exceptional clarity and smoothness with its 4K@60Hz HDMI port, making it ideal for high-definition presentations and entertainment. (Note: Only the HDMI port supports video projection; the USB-C port is for data transfer only.)
- Double Up on Efficiency: The two USB-A 3.0 ports and a USB-C port support a fast 5Gbps data rate, significantly boosting your transfer speeds and improving productivity.
- Fast and Reliable 85W Charging: Offers high-capacity, speedy charging for laptops up to 85W, so you spend less time tethered to an outlet and more time being productive.
- What You Get: Anker USB-C Hub (7-in-1), welcome guide, 18-month warranty, and our friendly customer service.
Element interaction exceptions
ElementClickInterceptedException
A different element would receive the click. Selenium targets the element’s center; an overlay covering that point can intercept the click even when the intended control is visible elsewhere. Pop-ups, modals, sticky navigation, overlapping UI, and animations are common things to inspect.
- Verify: Inspect the page at the moment of failure for an obstruction over the target’s center. Check whether an animation is still running or scrolling placed the target under a sticky header.
- Fix: Wait for the obstruction or animation to end, dismiss the relevant UI when appropriate, and position the target so its clickable area is unobstructed. Selenium’s interaction details are in Interacting with web elements.
ElementNotInteractableException
The requested operation cannot be performed on the element in its current state. The locator may identify the wrong node, the element may not support the requested operation, or it may not be displayed or usable in the viewport.
- Verify: Confirm that the element is the intended control and inspect whether it is displayed, within the usable viewport, and keyboard- or pointer-interactable for the action you are attempting.
- Fix: Locate the correct control and wait for the appropriate usable state. Bring an out-of-viewport target into view when needed; do not treat an unsuitable element as a timing problem.
Selenium’s error guidance and interaction documentation describe these conditions: Understanding Common Errors and Interacting with web elements.
Session and browser-driver exceptions
InvalidSessionIdException
The WebDriver session is no longer active. This can happen when code sends commands after quit(), after deleting the session, or after closing the last browser tab.
Rank #4
- Dual Converters, Infinite Potential:Includes 2× USB C male to USB A female adapters and 2× USB A male to USB C female adapters. Perfect for a wide range of uses—tablets with Bluetooth keyboards, expand USB ports on macbook, and more. Two different converters for all your daily needs
- Next-Level 10Gbps & 3A Charging: No more slow 480Mbps, this usb to usb c adapter has a transfer speed of up to 10Gbps, allowing you to do more transferring in less time. This usb adapter fits both USB A and USB C charger, supporting up to 3A fast charging
- Upgraded Exquisite Craftsmanship: With an aluminum alloy housing and metal connector, the usbc to usb adapter is extremely durable and sturdy. Rigorously tested to withstand more than 10,000 times of plugging and unplugging, ensuring long-lasting performance
- Broad Compatible: The usb c to usb adapter widely supports all USB C/ USB A devices like laptops, tablets, cellphones, car chargers, and phone chargers. Such as compatible with MacBook Pro/Air 2023/2022, Thunderbolt 4/3 Devices,Apple MagSafe Watch 9/8/7/SE/Ultra, iPad Pro 2022/2021, Samsung Galaxy S23/S20/S10, and iPhone 17/16/15 Pro. Plug and play
- Please Note: To reach 10Gbps speed, keep the cable under 3.3 ft. For USB A Male to USB C adapters, try flipping the USB C connector. USB C Male to USB A adapters support bidirectional 10Gbps transfer within 3.3 ft
- Verify: Trace where the driver is created and where teardown runs; check whether later code continues to issue commands on that driver.
- Fix: Correct the session lifecycle so commands run before teardown, and create a new session when later work needs a browser.
SessionNotCreatedException
WebDriver could not create a browser session. Selenium identifies possible causes including incompatible browser and driver versions, operating-system restrictions, and a missing, inaccessible, or non-executable driver binary.
- Verify: Check the browser and driver versions, confirm the browser binary is available, and inspect the executable’s path and permissions in the environment where the test runs.
- Fix: Resolve version compatibility or environment restrictions and ensure the driver executable is available and executable. Do this before changing page locators.
Driver-location errors
WebDriver needs a browser driver executable to communicate with the browser. The appropriate setup depends on the Selenium version, binding, and environment. Selenium’s current guidance discusses Selenium Manager, configuring a driver path through the binding’s Service mechanism, and supported driver-management libraries; check the guidance for your setup rather than copying old browser-specific instructions.
- Verify: Confirm which executable Selenium is trying to use and whether the process running the test can access and execute it.
- Fix: Use a supported driver-discovery or driver-path configuration method for the Selenium version and binding in use. See Unable to Locate Driver Error.
About the “49 exceptions” count
There is no canonical Selenium-wide list of exactly 49 common exceptions established by the Selenium sources cited here. The Selenium troubleshooting page explains a selection of common failures; the Python API reference catalogs Python exception classes for Selenium 4.50.0. Java, JavaScript, C#, Ruby, and Python do not necessarily expose identical exception inventories. Use the API reference for the specific binding and version installed in your project before relying on an exception name or counting a language-specific list.
Best Value
- 5-in-1 Connectivity: Equipped with a 4K HDMI port, a 5 Gbps USB-C data port, two 5 Gbps USB-A ports, and a USB C 100W PD-IN port. Note: The USB C 100W PD-IN port supports only charging and does not support data transfer devices such as headphones or speakers.
- Powerful Pass-Through Charging: Supports up to 85W pass-through charging so you can power up your laptop while you use the hub. Note: Pass-through charging requires a charger (not included). Note: To achieve full power for iPad, we recommend using a 45W wall charger.
- Transfer Files in Seconds: Move files to and from your laptop at speeds of up to 5 Gbps via the USB-C and USB-A data ports. Note: The USB C 5Gbps Data port does not support video output.
- HD Display: Connect to the HDMI port to stream or mirror content to an external monitor in resolutions of up to 4K@30Hz. Note: The USB-C ports do not support video output.
- What You Get: Anker 332 USB-C Hub (5-in-1), welcome guide, our worry-free 18-month warranty, and friendly customer service.
For the broader WebDriver context, see the Selenium Project’s WebDriver documentation.
Or skip the browser setup
If your task is to capture a page rather than run an interactive Selenium test, ScreenshotNeo is a website screenshot API and MCP server. One GET request can return a PNG, JPEG, WebP, or PDF. For example, using the supplied target URL:
Quick Recap
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 documentation for API details. Cookie banners, popups, and chat widgets are removed before capture; bot checks, blank pages, and failed loads are never billed. Its MCP server lets AI agents take screenshots, and the free plan includes 1,000 screenshots a month with no card; paid plans start at $5 for 3,000. Sign up for free.
Quick wins for a faster PC:
Repair Windows errors before they cause bigger problemsFix Now →Scan for outdated or missing drivers - takes under a minuteDriver Scan →Clear out junk files and repair common Windows errorsFree Scan →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.

