[🐛 Bug]: ChromeDriver producing NoSuchWindowException for v106+ on macOS
See original GitHub issueWhat happened?
After an auto update to chrome v106 and it’s corresponding driver, whenever we (at least 3 of us have reproduced the issue) try to run our selenium python tests on our mac development machines we get a NoSuchWindowException for tests longer than a few seconds. (Don’t know the exact cutoff time, but provided an example below) This was the same both before and after upgrading to macOS Ventura 13.0.
We can reproduce this for any v106 and v107 chrome versions, downgrading to chrome v105 (currently using chrome v105.0.5195.127 with driver v105.0.5195.19.0) does not have the issue and we are able to run using that. Latest version attempted is chrome v107.0.5304.87 with driver v107.0.5304.62
Running the same tests on a windows machine produced no issue.
How can we reproduce the issue?
from time import sleep
from selenium.webdriver import DesiredCapabilities, Keys
from selenium.webdriver.chrome.options import Options
import selenium
from selenium.webdriver.chrome.service import Service
from selenium.webdriver.common.by import By
from selenium.webdriver.support.wait import WebDriverWait
from webdriver_manager.chrome import ChromeDriverManager
caps = {"browserName": "chrome", 'goog:loggingPrefs': {'performance': 'ALL'}}
options = Options()
options.add_argument("window-size=1920,1080")
options.headless = False
driver = selenium.webdriver.Chrome(service=Service(ChromeDriverManager().install()), options=options, desired_capabilities=caps)
driver.get("https://www.google.com")
el = WebDriverWait(driver, 10).until(lambda d: d.find_element(by=By.CSS_SELECTOR, value="input[title='Search']"))
el.send_keys("Test")
el.send_keys(Keys.RETURN)
# Commenting out the sleep line causes the test to work every time.
# Leaving it in causes the test to fail every time.
sleep(10)
WebDriverWait(driver, 10).until(lambda d: d.find_element(by=By.XPATH, value="//a[text()='News']"))
driver.close()
Relevant log output
Traceback (most recent call last):
File "/Users/calumtimpany/PycharmProjects/test-automation/data/desktop/error_test.py", line 23, in <module>
WebDriverWait(driver, 10).until(lambda d: d.find_element(by=By.XPATH, value="//a[text()='News']"))
File "/Users/calumtimpany/PycharmProjects/test-automation/venv/lib/python3.8/site-packages/selenium/webdriver/support/wait.py", line 81, in until
value = method(self._driver)
File "/Users/calumtimpany/PycharmProjects/test-automation/data/desktop/error_test.py", line 23, in <lambda>
WebDriverWait(driver, 10).until(lambda d: d.find_element(by=By.XPATH, value="//a[text()='News']"))
File "/Users/calumtimpany/PycharmProjects/test-automation/venv/lib/python3.8/site-packages/selenium/webdriver/remote/webdriver.py", line 856, in find_element
return self.execute(Command.FIND_ELEMENT, {
File "/Users/calumtimpany/PycharmProjects/test-automation/venv/lib/python3.8/site-packages/selenium/webdriver/remote/webdriver.py", line 429, in execute
self.error_handler.check_response(response)
File "/Users/calumtimpany/PycharmProjects/test-automation/venv/lib/python3.8/site-packages/selenium/webdriver/remote/errorhandler.py", line 243, in check_response
raise exception_class(message, screen, stacktrace)
selenium.common.exceptions.NoSuchWindowException: Message: no such window: target window already closed
from unknown error: web view not found
(Session info: chrome=107.0.5304.87)
Stacktrace:
0 chromedriver 0x00000001039a62c8 chromedriver + 4752072
1 chromedriver 0x0000000103926463 chromedriver + 4228195
2 chromedriver 0x0000000103589b18 chromedriver + 441112
3 chromedriver 0x0000000103566210 chromedriver + 295440
4 chromedriver 0x00000001035ebe3d chromedriver + 843325
5 chromedriver 0x00000001035ff719 chromedriver + 923417
6 chromedriver 0x00000001035e7b33 chromedriver + 826163
7 chromedriver 0x00000001035b89fd chromedriver + 633341
8 chromedriver 0x00000001035ba051 chromedriver + 639057
9 chromedriver 0x000000010397330e chromedriver + 4543246
10 chromedriver 0x0000000103977a88 chromedriver + 4561544
11 chromedriver 0x000000010397f6df chromedriver + 4593375
12 chromedriver 0x00000001039788fa chromedriver + 4565242
13 chromedriver 0x000000010394e2cf chromedriver + 4391631
14 chromedriver 0x00000001039975b8 chromedriver + 4691384
15 chromedriver 0x0000000103997739 chromedriver + 4691769
16 chromedriver 0x00000001039ad81e chromedriver + 4782110
17 libsystem_pthread.dylib 0x00007ff817239259 _pthread_start + 125
18 libsystem_pthread.dylib 0x00007ff817234c7b thread_start + 15
Process finished with exit code 1
Operating System
macOS Ventura (13.0)
Selenium version
Python 4.5.0
What are the browser(s) and version(s) where you see this issue?
Chrome 106 through Chrome 107.0.5304.87
What are the browser driver(s) and version(s) where you see this issue?
ChromeDriver 107.0.5304.62
Are you using Selenium Grid?
No
Issue Analytics
- State:
- Created a year ago
- Reactions:3
- Comments:10 (3 by maintainers)

Top Related StackOverflow Question
Yeah, whatever the issue here, it’s a bug in chromedriver. Looks like Google is working on that issue, hopefully the same fix works for this issue as well.
This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.