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
• 770 points
6,228 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

I need help for below question as i need to submit the project...

Hi, @priyanka, Regarding your query, there are multiple ...READ MORE

answered Nov 26, 2020 in Selenium by Gitika
• 65,910 points
931 views
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 ffdfd
• 5,550 points
19,185 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,500 points
15,015 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,710 points
2,367 views
0 votes
2 answers

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,500 points
12,754 views
0 votes
2 answers

Problem while using InternetExplorerDriver in Selenium WebDriver

enable trusted connection  in internet explorer by ...READ MORE

answered Aug 31, 2020 in Selenium by Sri
• 3,190 points
8,623 views
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,910 points
6,697 views
0 votes
2 answers

How to use such xpath to find web elements

xpath are two types. 1) Absolute XPath:    /html/b ...READ MORE

answered Sep 3, 2020 in Selenium by Sri
• 3,190 points
7,561 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, 2019 in Selenium by nayan
• 160 points
12,454 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
40,727 views
webinar REGISTER FOR FREE WEBINAR X
REGISTER NOW
webinar_success Thank you for registering Join Edureka Meetup community for 100+ Free Webinars each month JOIN MEETUP GROUP