Windows Errors? Fix Them Before They Spread
Repair common Windows errors and clear accumulated junk for a smoother, more stable PC - no reinstall needed.Free scan · no reinstallOutdated 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 matchSome links on this page are affiliate links: if you buy through them we may earn a commission, at no extra cost to you.
Multiple IEDriverServer.exe processes after a failed Selenium test usually point to a teardown path that did not run, a startup failure that occurred before Selenium created a driver object, or child processes that were not reaped. driver.quit() is the normal cleanup operation when a session exists, but it cannot clean up through a driver object that was never created—and it does not guarantee every descendant process has exited. Track the driver service separately, run teardown on both success and failure, and verify the process tree rather than assuming that a returned quit() ended everything.
Why the processes remain
An IE-driver test involves a driver service and browser processes. A failure can occur at different points in that lifecycle, and the right cleanup depends on whether Selenium managed to create a usable session.
Teardown was skipped
An assertion failure, timeout, exception during test setup, or forced test-process termination may bypass code that calls driver.quit(). Cleanup written only at the bottom of a test method is especially vulnerable: control may never reach it. Put quit logic in the test framework’s guaranteed teardown or a language-level finally block, and make sure that hook also runs when test setup fails partway through.
Session startup failed before a driver object existed
quit() is an operation on a driver object. If session creation fails before that object is instantiated, there is nothing on which to call it. Selenium issue #15632 describes this startup-failure condition. In that case, cleanup needs a second handle: the service process identity recorded independently of the session object. Do not assume that catching the constructor exception and calling driver.quit() will work; driver may never have been assigned.
#1 Best Overall
Quit returned, but a child process survived
Selenium reports include orphaned driver processes and browser children remaining after quit. That means a successful call to quit() is not proof that every process in the tree has exited. Confirm what remains after teardown, and collect process IDs and driver logs if it does.
The execution model is a poor fit
The Selenium Project’s IE Driver Server documentation, current in 2026, says simultaneous InternetExplorerDriver instances are possible but “largely untested,” with possible issues including cookies and window focus. The same documentation says using IEDriverServer.exe as part of a Windows Service application is “expressly unsupported.” These are important constraints when diagnosing intermittent leaks in parallel tests or a service-hosted runner: do not treat either setup as a well-established configuration.
Identify which cleanup case you have
Before terminating anything, establish whether the process is left by a failed session startup, an unexecuted teardown hook, or incomplete child-process cleanup. Record the test run, timestamps, process IDs, and whether a driver object was successfully created. Inspect the process tree so you can distinguish processes belonging to the affected run from unrelated browser or driver activity.
Recommended Free Tools
| Situation | What to check | Cleanup implication |
|---|---|---|
| The test created a driver, then failed | Did the framework’s teardown or finally block execute? |
Call quit() in that guaranteed cleanup path. |
| Driver/session construction raised an exception | Was the driver object ever assigned? Was a service process started? | Use the separately recorded service PID; there may be no object on which to call quit(). |
quit() ran, but processes remain |
Which driver and browser PIDs are still present, and are they descendants of the test’s service? | Verify process-tree cleanup and preserve logs; do not infer that quit reaped every child. |
| Tests run in parallel or under a Windows service | Is the execution context the documented desktop-process use case, and are sessions isolated? | Windows Service execution is expressly unsupported; parallel IE-driver operation is largely untested. |
Make cleanup run on both success and failure
Use the test framework’s teardown hook where possible, because it can cover more than one test method and can run after an assertion failure. In a small script, use try/finally. Initialize the driver variable to None so the cleanup branch can tell whether session creation succeeded.
Rank #2
Python example: always quit an established session
This Selenium Python pattern handles exceptions after a driver object exists. The exact IE-driver setup parameters can vary with the Selenium version and local driver configuration; the important lifecycle rule is to put quit() in finally, not after the test body.
from selenium import webdriver
driver = None
try:
driver = webdriver.Ie()
driver.get("https://example.com")
# Run assertions and test actions here.
finally:
if driver is not None:
driver.quit()
Remove the leading space before driver = None if copying this block verbatim into a Python file; Python requires consistent indentation. Here is the correctly aligned version:
from selenium import webdriver
driver = None
try:
driver = webdriver.Ie()
driver.get("https://example.com")
# Run assertions and test actions here.
finally:
if driver is not None:
driver.quit()
This pattern cannot clean up a service process that started during a constructor failure before assignment to driver. For that case, arrange for the service launcher or test harness to expose and record the service PID independently, before session creation can fail. The service PID is a diagnostic and cleanup handle; it does not by itself prove which browser descendants belong to the run.
Free tools Windows power users keep installed
One-click scans. No signup required.
Framework teardown
In a test framework, create the driver in setup and close it in the framework’s guaranteed teardown hook. Keep the driver reference available to teardown if setup partially succeeds. If setup throws before the framework stores the driver, capture service startup details at the point the service is launched. When the framework’s lifecycle offers separate setup and teardown hooks, confirm the teardown behavior for setup failures rather than assuming it runs.
Rank #3
Track and verify the service process on Windows
When session creation fails, collect the service PID at launch through the mechanism that starts or supervises IEDriverServer.exe. Selenium issue #15632 documents why this independent tracking matters. Avoid relying on a process-name-wide kill: another test run or user session may have its own driver instance, and the name alone does not establish ownership.
After quit or service cleanup, inspect whether the recorded service PID still exists and whether browser descendants associated with that process remain. A read-only PowerShell snapshot can help capture process IDs and parent IDs for diagnosis:
Get-CimInstance Win32_Process |
Where-Object { $_.Name -in @('IEDriverServer.exe', 'iexplore.exe') } |
Select-Object ProcessId, ParentProcessId, Name, CommandLine
Run the snapshot before and after a test with a quiet, isolated environment if possible. Save the output alongside the test and driver logs. Process listings can change between observations, and an iexplore.exe process is not automatically attributable to the failed test; use the recorded PID, parent relationship, timing, and run isolation together. Terminate only a process you have identified as belonging to the failed run, following your organization’s process-management policy.
Do these 3 things before closing this tab:
1Scan for outdated or missing drivers - takes under a minute2Clear out junk files and repair common Windows errors3Fix the driver behind crashes, sound loss and screen glitchesChoose a cleanup strategy that matches the failure
| Strategy | Covers setup failure? | Tracks service PID independently? | Verifies children? | Best use |
|---|---|---|---|---|
driver.quit() in finally or teardown |
No, not if no driver object exists | No | No, verification is separate | Normal cleanup after session creation. |
| Record service PID at launch, then inspect after startup failure | Yes, if tracking is established before session creation | Yes | Only if process-tree inspection is added | Constructor or session-start failures. |
| Terminate every process with the driver’s image name | Not safely | No | No ownership verification | Avoid as routine cleanup; it can affect other runs. |
| Delay after quit/dispose | No | No | Not by itself | At most a targeted workaround if evidence matches the same client issue. |
A delay after Quit and Dispose has been reported as a workaround for one Selenium client issue (Selenium issue #10863), but that is environment-specific evidence, not a universal fix. Prefer finding which lifecycle step failed and verifying the relevant processes over adding an arbitrary sleep to every test.
Rank #4
Reduce recurrence and make failures diagnosable
- Keep cleanup in one reliable place. Use teardown or
finallyfor established sessions, including when assertions and test actions throw. - Record startup independently. Capture when the service is launched and its PID before session creation can fail. Preserve the startup exception as well as the process identity.
- Collect evidence before cleanup destroys it. Log the exception, driver logs, test-run identifier, service PID, and process-tree snapshot. That makes it easier to tell a skipped teardown from a surviving child.
- Validate parallelism rather than assuming it is safe. Selenium documents simultaneous IE-driver instances as largely untested. If parallel execution is necessary, isolate runs and investigate cookie or focus interference rather than attributing every symptom to teardown.
- Do not host IEDriverServer as a Windows Service. Selenium expressly marks that execution model unsupported. Use a supported desktop-process context for the IE-driver test instead.
- Compare browser behavior when diagnosing Selenium errors. Selenium’s troubleshooting guidance notes that underlying browser drivers can cause errors that appear to be Selenium failures. Reproduce with another browser where the test permits it before assigning the cause to Selenium core.
Troubleshooting common symptoms
“The test failed, so why did finally not run?”
A normal exception or assertion should transfer control through a language-level finally, but a forced process termination, machine shutdown, or a test runner that kills the worker can prevent ordinary cleanup. Check the runner’s own logs and whether the worker exited abruptly. A teardown hook also needs to be configured for the relevant test lifecycle, including setup failures.
“Calling quit raises another exception”
Keep the original test or startup exception in the logs; a cleanup exception should not erase the first failure. Record both. If the session was never established, handle cleanup through the separately tracked service process rather than assuming the driver object exists. If a session did exist, inspect the driver and browser process tree after the attempt.
“The process name is still listed after quit”
Compare PIDs and parent IDs with the run’s recorded service PID and pre-test snapshot. A process-name match alone does not prove it belongs to this test. If the service PID is gone but browser children remain, preserve that process-tree evidence; Selenium reports include cases where browser children survive quit.
“Leaks happen only in CI or in parallel runs”
Capture the same process and lifecycle evidence in a single, isolated run. Parallel IE sessions are documented as largely untested, and shared cookies or window focus can complicate interpretation. If the runner uses a Windows Service, that is outside the documented support model for IEDriverServer.exe.
Best Value
“Should I just add a sleep after quit?”
Not as a general remedy. A delay has been reported for one client issue, but the evidence is specific to that situation. First confirm whether the session existed, whether teardown ran, and which PID or descendant remained. Add a delay only if it addresses a reproduced timing behavior in your environment, and retain process verification.
Or skip the browser setup
If your actual task is producing website screenshots—not testing IE interactions, cookies, focus, or browser behavior—you can use ScreenshotNeo, a website screenshot API and MCP server, instead of managing a browser-driver process. It does not replace Selenium for browser automation or IE-specific tests.
One GET request returns a screenshot or PDF; see the ScreenshotNeo API documentation for request options. For a WebP shot of a page, provide your API key and target URL:
curl -G "https://api.screenshotneo.com/v1/shot"
-d access_key=YOUR_API_KEY
--data-urlencode url=https://example.com
-o shot.webp
ScreenshotNeo accepts cookie or consent banners like a visitor and removes more than 60 known consent platforms, newsletter popups, and chat widgets before capture; each step can be turned off. Bot checks or CAPTCHAs, blank pages, timeouts, failed loads, and cache hits are not billed, and responses identify the page verdict and billing status in headers. Its MCP server provides take_screenshot, get_page_info, and capture_pdf tools for AI agents and MCP clients. The Free plan includes 1,000 screenshots per month with no card; paid plans start at $5 for 3,000 shots.
Sign up for 1,000 free screenshots a month, with no card required.
Frequently Asked Questions
Does one leftover IEDriverServer.exe prove Selenium created a second session?
No. A process can remain after an unsuccessful startup or incomplete cleanup; inspect the run’s recorded service PID and process parentage before concluding that a second session was created.
Does this advice apply to every browser driver?
The lifecycle principles apply broadly, but the support statements here are specific to Selenium’s IE-driver documentation. Other drivers have their own documented behavior and should be assessed separately.
What’s actually slowing this PC down?
Pick the symptom - the matching free tool is one click away.
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.

