spectron
spectron copied to clipboard
Electron 10.3.0 and Spectron 12.0.0 gives error "Failed to create session"
Hello,
Im trying to run the electron-quick-start app using Electron 10.3.0 and Spectron 12.0.0 under node v12.18.3
Im getting the following error:
Application launch
1) "before each" hook for "shows an initial window"
0 passing (1s)
1 failing
1) Application launch
"before each" hook for "shows an initial window":
Error: Failed to create session.
unknown error: Chrome failed to start: exited abnormally.
(unknown error: DevToolsActivePort file doesn't exist)
(The process started from chrome location /Users/albertf/Test/electron-spectron-failed-to-create-session-error/node_modules/spectron/lib/launcher.js is no longer running, so ChromeDriver is assuming that Chrome has crashed.)
at Object.startWebDriverSession (node_modules/webdriver/build/utils.js:34:15)
at processTicksAndRejections (internal/process/task_queues.js:97:5)
I created a repo for reproducing same error https://github.com/alberto-f/electron-spectron-failed-to-create-session-error
Could someone help me spot what it is wrong in here ? AFAIK Im even using the right versions.
albertf@albertf-mac electron-quick-start % npm ls spectron electron
[email protected] /Users/albertf/Test/electron-quick-start
├── [email protected]
└── [email protected]
If you don't have the time, Could you tell me what version of Spectron should work with the electron-quick-start repo?
Thanks.
I got the same error, looks like a wrong version of Chrome browser in Spectron launcher https://github.com/electron-userland/spectron/issues/843
me too.
my package.json
"devDependencies": {
"electron": "^12.0.2",
"electron-builder": "^22.10.4",
"mocha": "^8.3.2"
},
"dependencies": {
"bootbox": "^5.4.0",
"bootstrap": "^3.3.7",
"spectron": "^14.0.0"
}
here's the output from github actions
Run npm run test
> [email protected] test /home/runner/work/electron-example/electron-example/bootbox
> mocha
Application launch
1) "before each" hook for "show an initial window"
0 passing (6s)
1 failing
1) Application launch
"before each" hook for "show an initial window":
Error: Failed to create session.
unknown error: Chrome failed to start: exited abnormally.
(unknown error: DevToolsActivePort file doesn't exist)
(The process started from chrome location /home/runner/work/electron-example/electron-example/bootbox/node_modules/spectron/lib/launcher.js is no longer running, so ChromeDriver is assuming that Chrome has crashed.)
at Object.startWebDriverSession (node_modules/webdriver/build/utils.js:34:15)
at processTicksAndRejections (internal/process/task_queues.js:93:5)
at async Function.newSession (node_modules/webdriver/build/index.js:35:45)
at async Object.exports.remote (node_modules/webdriverio/build/index.js:53:22)
Same here:
{
"devDependencies": {
...
"electron": "^12.0.5",
"spectron": "^14.0.0",
...
},
}
Has anyone found an answer to this issue? Same configurations as above:
$ npm test
[email protected] test /home/smaydew/projects/electron-spectron-example node ./node_modules/mocha/bin/_mocha --require esm --timeout 20000
Sample Test 1) "before each" hook for "opens a window"
0 passing (2s) 1 failing
- Sample Test "before each" hook for "opens a window": Error: Failed to create session. unknown error: Chrome failed to start: exited abnormally. (unknown error: DevToolsActivePort file doesn't exist) (The process started from chrome location /home/smaydew/projects/electron-spectron-example/node_modules/spectron/lib/launcher.js is no longer running, so ChromeDriver is assuming that Chrome has crashed.) at Object.startWebDriverSession (node_modules/webdriver/build/utils.js:34:15) at processTicksAndRejections (internal/process/task_queues.js:93:5) at async Function.newSession (node_modules/webdriver/build/index.js:35:45) at async Object.exports.remote (node_modules/webdriverio/build/index.js:53:22)
npm ERR! Test failed. See above for more details.
$ npm ls spectron electron [email protected] /home/smaydew/projects/electron-spectron-example ├── [email protected] └── [email protected]
Spectron does not work with contextIsolation=true
and enableRemoteModule=false
See #693