I have several drivers running connected to .NET core applications in Windows SO.
Unfortunately, the application may crash due to an error.
When I see this situation, I need to close the application and browser manually, but the chromedriver process continues to run.
How do I identify which chromedriver matches the application I closed?
The question on Selenium : How to stop geckodriver process impacting PC memory, without calling driver.quit()? dont resolve this need.
Asked
Active
Viewed 68 times
0

Mikail hP
- 29
- 4
1 Answers
0
Each time you initiate the execution of your tests a fresh set of ChromeDriver and google-chrome is created. So neither you are going to use the previous zombie ChromeDriver instances nor you would be able to access them.
Conclusion
The only optimal approach will be to kill them all and free up your system memory and you can use the following solution:
Python Solution(Cross Platform):
import os import psutil PROCNAME = "chromedriver" for proc in psutil.process_iter(): # check whether the process name matches if proc.name() == PROCNAME: proc.kill()
References
You can find a couple of relevant detailed discussions in:

undetected Selenium
- 183,867
- 41
- 278
- 352
-
The problem in this case is that there are other tests running. If I close all processes, I will need to restart all other tests. – Mikail hP Feb 06 '21 at 20:01
-
@MikailhP In all likelihood you won't trigger a cleanup when tests are getting executed within the same system. – undetected Selenium Feb 06 '21 at 22:54