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

chromedriver/chromebrowser does not exit after test ends (https://github.com/nightwatchjs/nightwatch/issues/2261) #4021

Open
SDETQATestAutomation opened this issue Feb 9, 2024 · 9 comments

Comments

@SDETQATestAutomation
Copy link

Description of the bug/issue

chromedriver does not exit after test ends
#2261

Steps to reproduce

  1. Go to '...'
  2. Click on '...'
  3. Scroll down to '...'
  4. See error

Sample test

No response

Command to run

No response

Verbose Output

No response

Nightwatch Configuration

No response

Nightwatch.js Version

3.4.0

Node Version

20.11.0

Browser

Chrome 121.0.6167.161

Operating System

Windows

Additional Information

This issue relates to (#2261)

@SDETQATestAutomation
Copy link
Author

@beatfactor Need urgent fix, on executing multiple test cases sequentially system is getting crashed and hanged. Multiple users are facing same issue in my organization.

@SDETQATestAutomation SDETQATestAutomation changed the title chromedriver does not exit after test ends (https://github.com/nightwatchjs/nightwatch/issues/2261) chromedriver/chromebrowser does not exit after test ends (https://github.com/nightwatchjs/nightwatch/issues/2261) Feb 9, 2024
@garg3133
Copy link
Member

garg3133 commented Feb 9, 2024

@SDETQATestAutomation You haven't provided any steps to reproduce this issue or the verbose output, so I am assuming that you are calling process.exit() somewhere in your test like the author was doing in the issue linked by you.

In that case, you'd need to call browser.end() command before executing process.exit() to request the webdriver server to close the browser connection.

@SDETQATestAutomation
Copy link
Author

@garg3133 @beatfactor I have used Nightwatch example code using cucumber and i can see multiple chrome browser still running after test end. You may need to execute your test multiple time. Please find attached gif file for reference of issue.
ChromeNotClosing

@garg3133
Copy link
Member

@SDETQATestAutomation I tried running the cucumber example locally but still couldn't reproduce the issue (all chrome processes end after the test).

Can you maybe share this sample project of yours so that we can try with that? I see from logs that it is creating a WebSocket connection to Chrome DevTools, so might be related to that.

@SDETQATestAutomation
Copy link
Author

@garg3133 Please find the attached code which i used for test execution.
NightwatchLatest.zip

@garg3133
Copy link
Member

I am still unable to reproduce this issue on my macOS system. It might be possible that this issue is only appearing on Windows, but unfortunately, we don't have access to Windows machines.

Can you maybe try uninstalling the chromedriver package (npm un chromedriver) if that helps?

cc: @AutomatedTester

@capGoblin
Copy link

Hi, I tried this test execution on my Windows machine, all the Chrome processes ended after the test.
However, my guess is that the processes may not have been terminated due to the lack of administrative privileges. If you're running the test on a standard user account (non-administrator account), give it a try on an administrator account to see if the issue persists.

@michepasto73
Copy link

hi SDETQATestAutomation, have you solved the problem? For two days now, I can see multiple Chrome browsers still running after the end of the test too. how did you solve it? I also use a Windows machine. Thank you.

@SDETQATestAutomation
Copy link
Author

hi SDETQATestAutomation, have you solved the problem? For two days now, I can see multiple Chrome browsers still running after the end of the test too. how did you solve it? I also use a Windows machine. Thank you.

@michepasto73 I have not fixed this issue yet, and currently i have to close chrome browser from task manger manually after each execution if we will not close browser System is getting slow and sometime it will require restart.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants