I need to release the memeory allocated to Selenium chromedriver.exe while for tests

0 votes
I have written my code in Python for performing a test with chromedriver.exe. At the end of the code, I am using browser.close() command to close the instance. (browser = webdriver.Chrome()) My belief is that, this would release chromedriver.exe from memory (I'm on Windows 7). But, after each run of the code, there is one chromedriver.exe instance which remains in memory. Is there anything else I can do on Python to terminate the instance immediately after?
May 21, 2018 in Selenium by eLiJha
• 720 points
817 views

1 answer to this question.

0 votes

The usage of the commands is incorrect.

  • driver.close() or browser.close() will only terminate the currenly running instance of chrome.
  • driver.quit() or browser.quit() will terminate all of the open windows, then exit webdriver.

But if your still left with closed ports on your system which you want to make use of...then I recomend writing a code similar to what I do at my workplace. I've written the code in C# and not in Python.....You can probably write an equivalent of this..

Process[] chromeDriverProcesses =  Process.GetProcessesByName("chromedriver");
foreach(var chromeDriverProcess in chromeDriverProcesses)
{
     chromeDriverProcess.Kill();
}
answered May 21, 2018 by sniffy_god
• 780 points

Related Questions In Selenium

0 votes
1 answer

How should I configure the chromedriver.exe in eclipse

Use the page factory pattern, working example: public ...READ MORE

answered Mar 27, 2018 in Selenium by Atul
• 5,530 points
4,633 views
0 votes
1 answer

Where do I get the ChromeDriver.exe from? The download link isn't available

You can download the chromedriver.exe from this ...READ MORE

answered Apr 3, 2018 in Selenium by nsv999
• 5,090 points
1,899 views
0 votes
1 answer

Need to integrate my Selenium tests with REST APIs

Selenium is good enough for this purpose...You ...READ MORE

answered Apr 18, 2018 in Selenium by king_kenny
• 3,650 points
422 views
0 votes
1 answer

Need to scroll down for locating an Element with Selenium

There are a couple of options for ...READ MORE

answered Apr 20, 2018 in Selenium by king_kenny
• 3,650 points
746 views
0 votes
1 answer

Finding WebDriver element with Class Name in java

The better way to handle this element ...READ MORE

answered Apr 10, 2018 in Selenium by nsv999
• 5,090 points
768 views
0 votes
1 answer
0 votes
1 answer

Geo-location microphone camera pop up

To Allow or Block the notification, access using Selenium and you have to ...READ MORE

answered May 11, 2018 in Selenium by Samarpit
• 5,130 points
1,011 views
0 votes
1 answer

How to use such xpath to find web elements

It's much simpler to use: #MyDiv123 > div.super or ...READ MORE

answered Jun 14, 2018 in Selenium by Samarpit
• 5,130 points
719 views
0 votes
2 answers

When executing my Jenkins tests with Selenium WebDriver, I do not see a GUI.

Hi eLiJha, I also faced the same issue ...READ MORE

answered Jul 15 in Selenium by nayan
• 160 points
1,236 views
+2 votes
1 answer

I want the console.log output from Chrome. I'm working with selenium on Python

So this is how you do it ...READ MORE

answered May 3, 2018 in Selenium by sniffy_god
• 780 points
11,292 views