Add driver.quit() to @AfterClass method
Close will close the current active window, and if this is the last window, quit () will be executed, but for this you need to have a valid active session.
If your test fails, the session is probably dead, so when you call it, it does not know where to send the command and does nothing.
Quit will disconnect all clients if there are no active sessions, so if you send out and do not have active sessions, it will simply clear
source share