Selenium web driver not able to close firefox instance if a Test cases is failed

和自甴很熟 提交于 2019-12-05 14:16:52

Add webdriver.quit() to an @AfterClass method.

close() will shut the current active window. If the current active window is the last window it is functionally equivalent to performing a quit().

It does however need to have a valid active session to be able to do this. If your test has failed that session is probably dead, so when you call a close() it doesn't know where to send the command and throws an Exception.

quit() will end all sessions and shut down all clients, it's basically a clean up everything command. It will also not throw any Exceptions if all clients/sessions have already been closed/ended.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!