When browser is closed and there is an error, the default run on failure functionality, Capture Page Screenshot, is run and it causes second exception. This is confusing for users, because there are two exceptions and it causes problems for detecting the real error, which happens when browser is closing.
We should alter SeleniumLibrary logic in such way that if there is error when browser(s) is closed and there is error raised by Selenium, the current browser is marked as _no_current() also when exception is raised. Now there is a bug in the WebDriverCache close and close_all methods that if exception is raised during driver.quit() the current remains active.
When browser is closed and there is an error, the default run on failure functionality, Capture Page Screenshot, is run and it causes second exception. This is confusing for users, because there are two exceptions and it causes problems for detecting the real error, which happens when browser is closing.
We should alter SeleniumLibrary logic in such way that if there is error when browser(s) is closed and there is error raised by Selenium, the current browser is marked as
_no_current()also when exception is raised. Now there is a bug in theWebDriverCachecloseandclose_allmethods that if exception is raised duringdriver.quit()thecurrentremains active.