0

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.

Task Manager

Mikail hP
  • 29
  • 4

1 Answers1

0

Each time you initiate the execution of your tests a fresh set of ChromeDriver and 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