You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The process returned by the start method should be enough to stop all additional child processes started by calling its kill method. Example of an expected usage:
constselenium=require('selenium-standalone')selenium.start({...},function(error,child){if(!error){// work with webdriverio and when finished, stop selenium:child.kill()// both selenium server and chromedriver process should exit}})
Current Behavior
Killing the process returned by the start method stops the selenium server (java) but the chromedriver process remains running. This occurs only, if the selenium process was actually used before trying to stop it. In my example, using WebdriverIO for just initialising and uninitialising the driver was enough:
If the driver usage by the above code was removed, both processes were stopped after calling the kill method of the returned child, as expected. Additionally, if a delay was introduced after calling the end method of the WebdriverIO client, the chromedriver process was topped too! It can be used as a workaround. Waiting for 1 ms was not enough, but waiting for 100 ms, or longer, helped:
Create a testing directory, install latest versions of the following npm modules there, download selenium.test.js there, execute it and check for running selenium processes:
npm i selenium-standalone
npm i webdriverio
node selenium.test.js
ps ax | grep selenium
Only the grep selenium process should be printed, but the chromedriver process from the "node_modules/selenium-standalone/.selenium" directory is printed too.
I wrote comments in the attached script about what do modify there to help the chromedriver process stop.
Logs
Executing the attached script with extra logging prints more information - see selenium.test.txt - but no information about the process-stopping phase.
Expected Behavior
The process returned by the
start
method should be enough to stop all additional child processes started by calling itskill
method. Example of an expected usage:Current Behavior
Killing the process returned by the
start
method stops the selenium server (java) but the chromedriver process remains running. This occurs only, if the selenium process was actually used before trying to stop it. In my example, using WebdriverIO for just initialising and uninitialising the driver was enough:If the driver usage by the above code was removed, both processes were stopped after calling the
kill
method of the returned child, as expected. Additionally, if a delay was introduced after calling theend
method of the WebdriverIO client, the chromedriver process was topped too! It can be used as a workaround. Waiting for 1 ms was not enough, but waiting for 100 ms, or longer, helped:Steps to Reproduce
Create a testing directory, install latest versions of the following npm modules there, download selenium.test.js there, execute it and check for running selenium processes:
npm i selenium-standalone npm i webdriverio node selenium.test.js ps ax | grep selenium
Only the
grep selenium
process should be printed, but thechromedriver
process from the "node_modules/selenium-standalone/.selenium" directory is printed too.I wrote comments in the attached script about what do modify there to help the chromedriver process stop.
Logs
Executing the attached script with extra logging prints more information - see selenium.test.txt - but no information about the process-stopping phase.
Testing Environment
Versions of Node.js and npm modules:
Operating system with latest updates applied:
$ lsb_release --all No LSB modules are available. Distributor ID: Ubuntu Description: Ubuntu Bionic Beaver (development branch) Release: 18.04 Codename: bionic $ uname -a Linux de08365 4.15.0-12-generic #13-Ubuntu SMP Thu Mar 8 06:24:47 UTC 2018 x86_64 x86_64 x86_64 GNU/Linux
The text was updated successfully, but these errors were encountered: