selenium.common.exceptions.NoSuchWindowException: Message: no such window: target window already closed from unknown error: web view not found
When i run the single job in Jenkins its working fine, But if i trigger the parallel jobs in Jenkins I'm getting below exception (Running with google chrome) Can someone help with this exception?
INTERNALERROR> Traceback (most recent call last):
INTERNALERROR> File "/var/lib/jenkins/.local/lib/python3.6/site-packages/_pytest/main.py", line 269, in wrap_session
INTERNALERROR> session.exitstatus = doit(config, session) or 0
INTERNALERROR> File "/var/lib/jenkins/.local/lib/python3.6/site-packages/_pytest/main.py", line 323, in _main
INTERNALERROR> config.hook.pytest_runtestloop(session=session)
INTERNALERROR> File "/var/lib/jenkins/.local/lib/python3.6/site-packages/pluggy/_hooks.py", line 265, in call
INTERNALERROR> return self._hookexec(self.name, self.get_hookimpls(), kwargs, firstresult)
INTERNALERROR> File "/var/lib/jenkins/.local/lib/python3.6/site-packages/pluggy/_manager.py", line 80, in _hookexec
INTERNALERROR> return self._inner_hookexec(hook_name, methods, kwargs, firstresult)
INTERNALERROR> File "/var/lib/jenkins/.local/lib/python3.6/site-packages/pluggy/_callers.py", line 60, in _multicall
INTERNALERROR> return outcome.get_result()
INTERNALERROR> File "/var/lib/jenkins/.local/lib/python3.6/site-packages/pluggy/_result.py", line 60, in get_result
INTERNALERROR> raise ex[1].with_traceback(ex[2])
INTERNALERROR> File "/var/lib/jenkins/.local/lib/python3.6/site-packages/pluggy/_callers.py", line 39, in _multicall
INTERNALERROR> res = hook_impl.function(*args)
INTERNALERROR> File "/var/lib/jenkins/.local/lib/python3.6/site-packages/_pytest/main.py", line 348, in pytest_runtestloop
INTERNALERROR> item.config.hook.pytest_runtest_protocol(item=item, nextitem=nextitem)
INTERNALERROR> File "/var/lib/jenkins/.local/lib/python3.6/site-packages/pluggy/_hooks.py", line 265, in call
INTERNALERROR> return self._hookexec(self.name, self.get_hookimpls(), kwargs, firstresult)
INTERNALERROR> File "/var/lib/jenkins/.local/lib/python3.6/site-packages/pluggy/_manager.py", line 80, in _hookexec
INTERNALERROR> return self._inner_hookexec(hook_name, methods, kwargs, firstresult)
INTERNALERROR> File "/var/lib/jenkins/.local/lib/python3.6/site-packages/pluggy/_callers.py", line 60, in _multicall
INTERNALERROR> return outcome.get_result()
INTERNALERROR> File "/var/lib/jenkins/.local/lib/python3.6/site-packages/pluggy/_result.py", line 60, in get_result
INTERNALERROR> raise ex[1].with_traceback(ex[2])
INTERNALERROR> File "/var/lib/jenkins/.local/lib/python3.6/site-packages/pluggy/_callers.py", line 39, in _multicall
INTERNALERROR> res = hook_impl.function(*args)
INTERNALERROR> File "/var/lib/jenkins/workspace/VF_SNOW_Python_Job/conftest.py", line 159, in pytest_runtest_protocol
INTERNALERROR> reports = runtestprotocol(item, nextitem=nextitem)
INTERNALERROR> File "/var/lib/jenkins/.local/lib/python3.6/site-packages/_pytest/runner.py", line 126, in runtestprotocol
INTERNALERROR> reports.append(call_and_report(item, "call", log))
INTERNALERROR> File "/var/lib/jenkins/.local/lib/python3.6/site-packages/_pytest/runner.py", line 217, in call_and_report
INTERNALERROR> report: TestReport = hook.pytest_runtest_makereport(item=item, call=call)
INTERNALERROR> File "/var/lib/jenkins/.local/lib/python3.6/site-packages/pluggy/_hooks.py", line 265, in call
INTERNALERROR> return self._hookexec(self.name, self.get_hookimpls(), kwargs, firstresult)
INTERNALERROR> File "/var/lib/jenkins/.local/lib/python3.6/site-packages/pluggy/_manager.py", line 80, in _hookexec
INTERNALERROR> return self._inner_hookexec(hook_name, methods, kwargs, firstresult)
INTERNALERROR> File "/var/lib/jenkins/.local/lib/python3.6/site-packages/pluggy/_callers.py", line 55, in _multicall
INTERNALERROR> gen.send(outcome)
INTERNALERROR> File "/var/lib/jenkins/workspace/VF_SNOW_Python_Job/conftest.py", line 42, in pytest_runtest_makereport
INTERNALERROR> extra.append(pytest_html.extras.url(get_current_url()))
INTERNALERROR> File "/var/lib/jenkins/workspace/VF_SNOW_Python_Job/helpers/mcmp_driver_manager.py", line 152, in get_current_url
INTERNALERROR> return driver.current_url
INTERNALERROR> File "/var/lib/jenkins/.local/lib/python3.6/site-packages/selenium/webdriver/remote/webdriver.py", line 669, in current_url
INTERNALERROR> return self.execute(Command.GET_CURRENT_URL)['value']
INTERNALERROR> File "/var/lib/jenkins/.local/lib/python3.6/site-packages/selenium/webdriver/remote/webdriver.py", line 321, in execute
INTERNALERROR> self.error_handler.check_response(response)
INTERNALERROR> File "/var/lib/jenkins/.local/lib/python3.6/site-packages/selenium/webdriver/remote/errorhandler.py", line 242, in check_response
INTERNALERROR> raise exception_class(message, screen, stacktrace)
INTERNALERROR> selenium.common.exceptions.NoSuchWindowException: Message: no such window: target window already closed
INTERNALERROR> from unknown error: web view not found
INTERNALERROR> (Session info: headless chrome=89.0.4389.114)
Traceback (most recent call last):
File "/usr/lib64/python3.6/runpy.py", line 193, in _run_module_as_main
"main", mod_spec)
File "/usr/lib64/python3.6/runpy.py", line 85, in _run_code
exec(code, run_globals)
File "/var/lib/jenkins/.local/lib/python3.6/site-packages/pytest/main.py", line 5, in
Google chrome=89.0.4389.114 Chrome Driver version = 89.0.4389.23
using these browser options
options.binary_location = "/usr/bin/google-chrome"
options.add_argument("--remote-debugging-port=9222")
options.add_argument("--disable-gpu")
options.add_argument("--disable-infobars")
options.add_argument('--no-sandbox')
options.add_argument('--disable-dev-shm-usage')
options.add_argument("--aggressive-cache-discard")
options.add_argument("--disable-cache")
options.add_argument("--disable-offline-load-stale-cache")
options.add_argument("--disk-cache-size=0")
options.add_argument("--headless")
options.add_argument("--dns-prefetch-disable")
options.add_argument("--no-proxy-server")
options.add_argument("--log-level=3")
options.add_argument("--silent")
options.add_argument("--disable-browser-side-navigation")
options.add_argument("--disable-features=VizDisplayCompositor")
#options.setPageLoadStrategy(PageLoadStrategy.NORMAL)
options.page_load_strategy = 'normal'
Hello, Today we also have somes issues at driver.close():
Failed to quit driver with following error: OpenQA.Selenium.WebDriverException: invalid session id Failed to quit driver with following error: OpenQA.Selenium.WebDriverException: chrome not reachable
I'm not sure if it's the same issue or not, but could be related. Reproducing only when we run from jenkins
(Session info: chrome=99.0.4844.51)
@tpetru Yes i'm seeing this exception only in jenkins with parallell jobs execution.
@AnandPalabhavi it seems to be specific to version 89.0. Is it reproducing with an older version?
@vania-pooh U mean 99.0 I assume. For now it's seems to not repro with 98.0
@vania-pooh i have started with v89.0.4389, where the protractor code work but not Selenium with python code.
@Dor-bl For you its working with 98 version ? did you tried with parallel job execution through jenkins ?
@AnandPalabhavi Yes, it work for me with Chrome 98.0 in parallel through Jenkins
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.