selenium close current driver but don 27t quit

Solutions on MaxInterview for selenium close current driver but don 27t quit by the best coders in the world

showing results for - "selenium close current driver but don 27t quit"
Mariana
25 Feb 2018
1# driver.close() closes one tab
2# driver.quit() quits the session
3
4# this closes all tabs but doesnt quit the session as a whole
5alltabs = driver.window_handles
6for i in range(len(alltabs)):
7	driver.switch_to.window(alltabs[i])
8	driver.close();sleep(1)