Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

quit() does not quit remote browser instance #5003

Closed
im-n1 opened this issue Nov 3, 2017 · 1 comment
Closed

quit() does not quit remote browser instance #5003

im-n1 opened this issue Nov 3, 2017 · 1 comment

Comments

@im-n1
Copy link

im-n1 commented Nov 3, 2017

Meta -

OS:
Linux
Selenium Version:
3.6.0
Browser:
Chrome

I use Docker selenium/chrome-standalone in version 3.6.0

Expected Behavior

To quit browser, clean up memory, stop process.

Actual Behavior

Tons of Chrome + Java threads remain hanging in the system after my task finishes. i5 CPU is on 95% on all cores and memory on 8gigs.

Steps to reproduce -

I hava a loop and in each loop step I start new driver instance (remote one), go to URL, do what I want and then i call close() and quit(). I also wait for 5 secs (just to be sure the browsers gets quit and memory and threads are maintained. Then new loop step starts over.

I do that because whenI try to start up one browser window and process all my URLs in that instance Selenium quits on like 10th URL - memory error/unexpected crash.

This is how I start the browser:

opts = Options()
opts.add_argument("user-agent={}".format(my_user_agent))
self.browser = webdriver.Remote(command_executor="http://selenium:4444/wd/hub", desired_capabilities=opts.to_capabilities())
self.browser.get(.....)

This is how I try to quit the instance:

self.browser.close()  # Was added as advice found on stack overflow.
self.browser.quit()
sleep(5)

Guys what I'm doing wrong in terms of quiting the browser/driver instance? Or tell me, how to "dig into" system (don't forget I use Remote driver) and kill the threads manually?

Thanks a lot.

@barancev
Copy link
Member

barancev commented Nov 5, 2017

This is a question rather than an issue. Please send questions to the selenium user group

For issues please provide a concise reproducible test case and describe what results you are seeing and what results you expect.

See CONTRIBUTING.md

@barancev barancev closed this as completed Nov 5, 2017
@lock lock bot locked and limited conversation to collaborators Aug 17, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants