Closing the geckodriver.exe or chromedriver.exe files at once:
In every selenium script, we use the statement driver.close() or driver.quit() which will close the browser. It’s not only closes the browser but it also closes the background driver.exe files. (chromedriver.exe or firefoxdriver.exe files).
But when you are practicing the examples you won’t close the browsers because if you close them you can’t see your expected results. This will cause a lot of driver.exe files opened in the background and this might make your scripts slow down.
You can go ahead and close them one by one but it will take a lot of time for you. So you can use command prompt to close all these driver.exe files at ones.
Open command prompt, and use the following commands to close all the driver.exe files at once.
taskkill /IM "chromedriver.exe" /F – For killing all the open chromedriver.exe tasks in the background
taskkill /IM “geckodriver.exe” /F – For killing all the open geckodriver.exe files in the background