I am working on the latest puppeteer on the Mac-OS, instead of using the default Chromium, I want to use the default chrome, however this doesn't work properly
const browser = await puppeteer.launch({
userDataDir: "./public/puppeteer",
headless: false,
devtools: true ,
args: [
"--no-sandbox",
`--window-size=${ width },${ height }`
],
executablePath:'/Applications/Google\ Chrome.app/Contents/MacOS/Google\ Chrome --remote-debugging-port=9222 --no-first-run --no-default-browser-check '
});
"error":{"message":"Failed to launch the browser process! spawn /Applications/GoogleChrome.app/Contents/MacOS/GoogleChrome --remote-debugging-port=9222
--no-first-run --no-default-browser-check ENOENT\n\n\n",
"stack":"Error: Failed to launch the browser process! spawn /Applications/GoogleChrome.app/Contents/MacOS/GoogleChrome --remote-debugging-port=9222
--no-first-run --no-default-browser-check ENOENT\n\n\n\n
at onClose (/Users/xisizhe/Documents/code/server/node_modules/puppeteer-core/lib/cjs/puppeteer/node/BrowserRunner.js:299:20)\n
at ChildProcess.<anonymous> (/Users/xisizhe/Documents/code/server/node_modules/puppeteer-core/lib/cjs/puppeteer/node/BrowserRunner.js:293:24)\n
at ChildProcess.emit (node:events:513:28)\n at Process.ChildProcess._handle.onexit (node:internal/child_process:291:12)\n
at onErrorNT (node:internal/child_process:485:16)\n at processTicksAndRejections (node:internal/process/task_queues:83:21)"},
"exception":true,"level":"error","message":"uncaughtException: Failed to launch the browser process!
spawn /Applications/GoogleChrome.app/Contents/MacOS/GoogleChrome --remote-debugging-port=9222
--no-first-run --no-default-browser-check ENOENT\n\n\n\nError: Failed to launch the browser process! spawn
/Applications/GoogleChrome.app/Contents/MacOS/GoogleChrome --remote-debugging-port=9222 --no-first-run --no-default-browser-check
ENOENT\n\n\n\n at onClose (/Users/xisizhe/Documents/code/server/node_modules/puppeteer-core/lib/cjs/puppeteer/node/BrowserRunner.js:299:20)\n
at ChildProcess.<anonymous> (/Users/xisizhe/Documents/code/server/node_modules/puppeteer-core/lib/cjs/puppeteer/node/BrowserRunner.js:293:24)\n
at ChildProcess.emit (node:events:513:28)\n at Process.ChildProcess._handle.onexit (node:internal/child_process:291:12)\n
at onErrorNT (node:internal/child_process:485:16)\n at processTicksAndRejections (node:internal/process/task_queues:83:21)"
have any idea how to find the problem and solution ?
Related
I'm trying to run "ng e2e" command with octopus with following configuration but getting below error all the time:
[07:20:37] E/launcher - session not created: This version of ChromeDriver only supports Chrome version 79
(Driver info: chromedriver=79.0.3945.16 (93fcc21110c10dbbd49bbff8f472335360e31d05-refs/branch-heads/3945#{#262}),platform=Windows NT 10.0.14393 x86_64)
[07:20:37] E/launcher - SessionNotCreatedError: session not created: This version of ChromeDriver only supports Chrome version 79
(Driver info: chromedriver=79.0.3945.16 (93fcc21110c10dbbd49bbff8f472335360e31d05-refs/branch-heads/3945#{#262}),platform=Windows NT 10.0.14393 x86_64)
at Object.checkLegacyResponse (D:\a\1\s\node_modules\selenium-webdriver\lib\error.js:546:15)
at parseHttpResponse (D:\a\1\s\node_modules\selenium-webdriver\lib\http.js:509:13)
at D:\a\1\s\node_modules\selenium-webdriver\lib\http.js:441:30
at processTicksAndRejections (internal/process/task_queues.js:93:5)
From: Task: WebDriver.createSession()
at Function.createSession (D:\a\1\s\node_modules\selenium-webdriver\lib\webdriver.js:769:24)
at Function.createSession (D:\a\1\s\node_modules\selenium-webdriver\chrome.js:761:15)
at Direct.getNewDriver (D:\a\1\s\node_modules\protractor\built\driverProviders\direct.js:77:33)
at Runner.createBrowser (D:\a\1\s\node_modules\protractor\built\runner.js:195:43)
at D:\a\1\s\node_modules\protractor\built\runner.js:339:29
at _fulfilled (D:\a\1\s\node_modules\protractor\node_modules\q\q.js:834:54)
at D:\a\1\s\node_modules\protractor\node_modules\q\q.js:863:30
at Promise.promise.promiseDispatch (D:\a\1\s\node_modules\protractor\node_modules\q\q.js:796:13)
at D:\a\1\s\node_modules\protractor\node_modules\q\q.js:556:49
at runSingle (D:\a\1\s\node_modules\protractor\node_modules\q\q.js:137:13)
[07:20:37] E/launcher - Process exited with error code 199
An unexpected error occurred: undefined
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! rebar-spa-v2-template#0.0.3 e2e: `ng e2e`
Configuration is:
user-agent = "npm/6.12.1 node/v12.13.1 win32 x64"
Protractor.conf.js:
capabilities: {
'browserName': 'chrome',
chromeOptions: {
args: ['--headless', '--disable-gpu', '--window-size=800,600']
}
},
Package.json: tried with both of solution
postinstall: webdriver-manager update --versions.chrome 79.0.3945.36
or
postinstall: cd ./node_modules/protractor && npm i webdriver-manager#latest
Any help will be appreciated.
This error message...
session not created: This version of ChromeDriver only supports Chrome version 79 (Driver info: chromedriver=79.0.3945.16 (93fcc21110c10dbbd49bbff8f472335360e31d05-refs/branch-heads/3945#{#262}),platform=Windows NT 10.0.14393 x86_64)
...implies that the ChromeDriver was unable to initiate/spawn a new Browsing Context i.e. Chrome Browser session.
Your main issue is the incompatibility between the version of the binaries you are using as follows:
You are using chromedriver=79.0.3945.16
Release Notes of chromedriver=79.0.3945.16 clearly mentions the following :
Supports Chrome v79
Presumably you are using a Chrome with a version other then chrome= 79.0
Possibly the following command fails:
webdriver-manager update --versions.chrome 79.0.3945.36
So there is a clear mismatch between the ChromeDriver v79.0 and your current Chrome Browser
Solution
Ensure the following mentioned steps will solve the issue:
You may need to clean up once:
webdriver-manager clean
You have the latest version of webdriver-manager and you can install the same using the command:
webdriver-manager#latest --save
Execute the following command will solve your issue:
webdriver-manager update
Upgrade Chrome to the latest stable release:
webdriver-manager update --versions.chrome 79.0.3945.88
I got this message when my system downloaded Chrome 90 in the background, even though my browser still said 89 (to be fair it was prompting me to update). I tried a few things but in the end I just ran npm uninstall chromedriver and then npm install chromedriver and everything started working again. Not ideal but I'm happy my tests are able to run.
EDIT:
I noticed that running the above commands updated my package.json file so it now said "chromedriver": "^90.0.0" in it. I'm guessing I could have made that version change myself and run npm install chromedriver to download the updated driver file. I'll try that next time.
The reason for me was that chromedriver was installed globally. Need just do npm i chromedriver -g
I'm trying to run my test cases on Fargate using Chimp, which internally uses Webdriver.io / Selenium. They run just fine in my docker container when I'm running them on my EC2 instance, but as soon as I upload my container to ECS and try to execute the same test using Fargate, I get the following error:
Chimp version: 0.50.2
ChromeDriver version: ChromeDriver 2.34.522913 (36222509aa6e819815938cbf2709b4849735537c)
Java version: openjdk version "1.8.0_151", OpenJDK Runtime Environment (build 1.8.0_151-8u151-b12-1~deb9u1-b12), OpenJDK 64-Bit Server VM (build 25.151-b12, mixed mode)
Selenium version: 3.8.1
Selenium drivers version: chrome: 2.34, ie: 2.50.0, firefox: 0.19.1
OS version: Linux 4.9.62-21.56.amzn1.x86_64
Node version: v6.11.5
Browser version: chrome undefined
[33m
[chimp] Running...[39m
[chimp][helper] setupBrowserAndDDP had error
{ Error: unknown error: Chrome failed to start: exited abnormally
at initBrowser (node_modules/chimp/dist/lib/chimp-helper.js:189:43)
at Object.setupBrowserAndDDP (node_modules/chimp/dist/lib/chimp-helper.js:264:7)
at node_modules/chimp/dist/lib/cucumberjs/hooks.js:22:24
at node_modules/meteor-promise/fiber_pool.js:43:40
(Driver info: chromedriver=2.34.522913 (36222509aa6e819815938cbf2709b4849735537c),platform=Linux 4.9.62-21.56.amzn1.x86_64 x86_64)
at new RuntimeError (node_modules/webdriverio/build/lib/utils/ErrorHandler.js:144:12)
at Request._callback (node_modules/webdriverio/build/lib/utils/RequestHandler.js:313:39)
at Request.self.callback (node_modules/request/request.js:186:22)
at emitTwo (events.js:106:13)
at Request.emit (events.js:191:7)
at Request.<anonymous> (node_modules/request/request.js:1163:10)
at emitOne (events.js:96:13)
at Request.emit (events.js:188:7)
at IncomingMessage.<anonymous> (node_modules/request/request.js:1085:12)
at IncomingMessage.g (events.js:292:16)
at emitNone (events.js:91:20)
at IncomingMessage.emit (events.js:185:7)
at endReadableNT (_stream_readable.js:974:12)
at node_modules/continuation-local-storage/node_modules/async-listener/glue.js:188:31
at _combinedTickCallback (internal/process/next_tick.js:80:11)
at process._tickDomainCallback [as _tickCallback] (internal/process/next_tick.js:128:9)
details: undefined,
message: 'unknown error: Chrome failed to start: exited abnormally\n (Driver info: chromedriver=2.34.522913 (36222509aa6e819815938cbf2709b4849735537c),platform=Linux 4.9.62-21.56.amzn1.x86_64 x86_64)',
type: 'RuntimeError',
seleniumStack:
{ type: 'UnknownError',
message: 'An unknown server-side error occurred while processing the command.',
orgStatusMessage: 'unknown error: Chrome failed to start: exited abnormally\n (Driver info: chromedriver=2.34.522913 (36222509aa6e819815938cbf2709b4849735537c),platform=Linux 4.9.62-21.56.amzn1.x86_64 x86_64)' } }
Error: unknown error: Chrome failed to start: exited abnormally
at initBrowser (node_modules/chimp/dist/lib/chimp-helper.js:189:43)
at Object.setupBrowserAndDDP (node_modules/chimp/dist/lib/chimp-helper.js:264:7)
at node_modules/chimp/dist/lib/cucumberjs/hooks.js:22:24
at node_modules/meteor-promise/fiber_pool.js:43:40
(Driver info: chromedriver=2.34.522913 (36222509aa6e819815938cbf2709b4849735537c),platform=Linux 4.9.62-21.56.amzn1.x86_64 x86_64)
at new RuntimeError (node_modules/webdriverio/build/lib/utils/ErrorHandler.js:144:12)
at Request._callback (node_modules/webdriverio/build/lib/utils/RequestHandler.js:313:39)
at Request.self.callback (node_modules/request/request.js:186:22)
at emitTwo (events.js:106:13)
at Request.emit (events.js:191:7)
at Request.<anonymous> (node_modules/request/request.js:1163:10)
at emitOne (events.js:96:13)
at Request.emit (events.js:188:7)
at IncomingMessage.<anonymous> (node_modules/request/request.js:1085:12)
at IncomingMessage.g (events.js:292:16)
at emitNone (events.js:91:20)
at IncomingMessage.emit (events.js:185:7)
at endReadableNT (_stream_readable.js:974:12)
at node_modules/continuation-local-storage/node_modules/async-listener/glue.js:188:31
at _combinedTickCallback (internal/process/next_tick.js:80:11)
at process._tickDomainCallback [as _tickCallback] (internal/process/next_tick.js:128:9)
Cucumber steps failed
I've tried adding the following lines to the start of my test script to make sure Chrome is there and responding:
echo Running chrome version:
google-chrome --version
And the result is:
Running chrome version:
Google Chrome 62.0.3202.75
So Chrome is there and responding. Why won't it work in Fargate?
The following debug line from the Chimp debug info at the start looks like the biggest culprit:
Browser version: chrome undefined
I have no idea why it can't find it. It reports the correct version when I'm running locally.
You might also try Xvfb for the framebuffer without Headless Chrome, in the event --headless mode doesn't work with your application (which seems to be a somewhat frequent event).
A long time later I learned that my docker container hadn't successfully finished all of it's operations before I was saving the image. When I fixed that, this problem went away. X11 runs fine in a Docker container / AWS Fargate.
Protractor was running fine but suddenley won't run chrome anymore. This is mye current configuration:
exports.config = {
baseUrl: 'http://localhost:1384/#/',
framework: 'jasmine',
seleniumAddress: 'http://localhost:4444/wd/hub',
specs: ['./tests/e2e/*.js'],
multiCapabilities: [{
//'browserName': 'firefox',
'browserName': 'chrome',
},
],
jasmineNodeOpts: {
showColors: true
}
}
I am running latest of all the related dependencies:
protractor : "protractor": "^5.2.0",
chromedriver: 2.33.506092
webdriver: selenium standalone version available: 3.7.1 [last]
when I run webdriver-manager start eveything runs fine, and then running protractor conf.js gives the following output in the window running the selenium server:
Starting ChromeDriver 2.33.506092 Only local connections are allowed.
The terminal windows running the protractor config, gives the following errros:
E/launcher - WebDriverError: unknown error: Chrome failed to start: exited abnormally
I have already tried reinstalling protractor and updating the chromedriver. Running the tests work fine in firefox with the exact same configurations.
I am also running tests with karma, and karma runs fine in a chrome browser window.
Add directConnect: true to your config file. It might help you.
this would be your conf file
exports.config = {
directConnect: true,
// Capabilities to be passed to the webdriver instance.
capabilities: {
'browserName': 'chrome',
},
// Framework to use. Jasmine is recommended.
framework: 'jasmine',
baseUrl: "YOUR URL",
// Spec patterns are relative to the current working directory when
// protractor is called.
specs: ['../Tests/test.js'],
// Options to be passed to Jasmine.
jasmineNodeOpts: {
defaultTimeoutInterval: 30000
},
};
you don't need to give below dependencies because chrome get launched from conf file only
chromedriver: 2.33.506092
webdriver: selenium standalone version available: 3.7.1 [last]
Ran into similar issue. Try updating chrome which should fetch the new compatible chrome driver.
I am trying to run test with selenium and chromedriver.
i have a centos 6.7 installed chrome and used chrome lib from chromedriver ( found script here https://chrome.richardlloyd.org.uk/)
front:
extensions:
Behat\MinkExtension:
base_url: 'http://urlfront/'
browser_name: chrome
sessions:
default:
selenium2:
wd_host: 'http://127.0.0.1:4444/wd/hub'
capabilities:
browser: chrome
suites:
front:
filters:
tags: front
admin:
extensions:
Behat\MinkExtension:
base_url: 'http://url/'
browser_name: chrome
sessions:
default:
selenium2:
wd_host: 'http://localhost:4444/wd/hub'
capabilities:
browser: chrome
suites:
admin:
filters:
tags: admin
this is my behat .yml
im starting selenium with this command :
java -jar selenium-server-standalone.jar -trustAllSSLCertificates -Djava.net.preferIPv4Stack=true -Dwebdriver.chrome.driver=chromedriver -Dwebdriver.chrome.bin=/opt/google/chrome/google-chrome
when I run behat, i got an error on selenium
[27,690][SEVERE]: CreatePlatformSocket() returned an error, errno=97: Famille d'adresses non supportée par le protocole ( address family not supported)
this error loop for a while and at the end it show me this
12:01:01.718 WARN - Exception: unknown error: Chrome failed to start: exited abnormally
(Driver info: chromedriver=2.23.409687 (c46e862757edc04c06b1bd88724d15a5807b84d1),platform=Linux 2.6.32-573.el6.x86_64 x86_64) (WARNING: The server did not provide any stacktrace information)
I don't know where to search, is that an error from chrome not starting or protocol not supported or both ?
hope someone can help me on this I tried a lot of things reinstalled chrome with the script but maybe it was not cleaned and I still have a wrong version ?
What I'm trying to achieve
Successfully run my protractor tests on headless chrome on Ubuntu 14 non gui.
Set up
Using multiple reference pages I have managed to successfully install: Xvfb Chrome latest browser Protractor 3.3.0 Java 7 (also tried with Java 8) and also set the LOCAL_HOME. Also, managed to start the Xvfb using this reference.
Protractor conf
exports.config = {
baseUrl: 'http://<qa environment>',
framework: 'jasmine',
seleniumAddress: 'http://localhost:4444/wd/hub',
jasmineNodeOpts: {
showColors:true,
defaultTimeoutInterval: 2500000
},
capabilities: {
'browserName': 'chrome'
},
specs: ['administration/*-spec.js'], //'signinandout/*-spec.js', 'homepage/*-spec.js',
onPrepare: function(){
//browser.driver.manage().window().setSize(1280, 1080);
}
}
Exception stack trace:
/usr/local/lib/node_modules/protractor/node_modules/selenium-webdriver/error.js:26
constructor(opt_error) {
^ WebDriverError: unknown error: Chrome failed to start: exited abnormally (Driver info:
chromedriver=2.21.371461
(633e689b520b25f3e264a2ede6b74ccc23cb636a),platform=Linux
3.13.0-87-generic x86_64) (WARNING: The server did not provide any stacktrace information) Command duration or timeout: 60.16 seconds
Build info: version: '2.52.0', revision: '4c2593c', time: '2016-02-11
19:06:42' System info: host: 'vagrant-ubuntu-trusty-64', ip:
'10.0.2.15', os.name: 'Linux', os.arch: 'amd64', os.version:
'3.13.0-87-generic', java.version: '1.7.0_101' Driver info:
org.openqa.selenium.chrome.ChromeDriver
at WebDriverError (/usr/local/lib/node_modules/protractor/node_modules/selenium-webdriver/error.js:26:26)
at Object.checkLegacyResponse (/usr/local/lib/node_modules/protractor/node_modules/selenium-webdriver/error.js:580:13)
at /usr/local/lib/node_modules/protractor/node_modules/selenium-webdriver/lib/webdriver.js:64:13
at Promise.invokeCallback_ (/usr/local/lib/node_modules/protractor/node_modules/selenium-webdriver/lib/promise.js:1329:14)
at TaskQueue.execute_ (/usr/local/lib/node_modules/protractor/node_modules/selenium-webdriver/lib/promise.js:2790:14)
at TaskQueue.executeNext_ (/usr/local/lib/node_modules/protractor/node_modules/selenium-webdriver/lib/promise.js:2773:21)
at /usr/local/lib/node_modules/protractor/node_modules/selenium-webdriver/lib/promise.js:2652:27
at /usr/local/lib/node_modules/protractor/node_modules/selenium-webdriver/lib/promise.js:639:7
at process._tickCallback (internal/process/next_tick.js:103:7) From: Task: WebDriver.createSession()
at acquireSession (/usr/local/lib/node_modules/protractor/node_modules/selenium-webdriver/lib/webdriver.js:62:22)
at Function.createSession (/usr/local/lib/node_modules/protractor/node_modules/selenium-webdriver/lib/webdriver.js:295:12)
at Builder.build (/usr/local/lib/node_modules/protractor/node_modules/selenium-webdriver/builder.js:458:24)
at Hosted.DriverProvider.getNewDriver (/usr/local/lib/node_modules/protractor/built/driverProviders/driverProvider.js:37:33)
at Runner.createBrowser (/usr/local/lib/node_modules/protractor/built/runner.js:182:43)
at /usr/local/lib/node_modules/protractor/built/runner.js:255:30
at _fulfilled (/usr/local/lib/node_modules/protractor/node_modules/q/q.js:834:54)
at self.promiseDispatch.done (/usr/local/lib/node_modules/protractor/node_modules/q/q.js:863:30)
at Promise.promise.promiseDispatch (/usr/local/lib/node_modules/protractor/node_modules/q/q.js:796:13)
at /usr/local/lib/node_modules/protractor/node_modules/q/q.js:556:49
[01:09:14] E/launcher - Process exited with error code 1
Check your Google chrome Version and its compatibility with the chrome driver.
You can check that from the Chromedriver Site and download the compatible version.
It worked for me.
probably your window screen size is not matching try giving maximize in onPrepare:
onPrepare: function(){
browser.driver.manage().window().maximize();
}
Open your project and Please update your npm modules by the following command.
project_root:\> npm update
Now update your selenium driver to the latest version using the following command
project_root:\> webdriver-manager update
Run your tests again.
Error due to Xvfb display is not specified here. Here , Selenium scripts are running using headless browser testing concept which is without GUI.
Hope u have used chromedriver, chrome binaries and XVfb. here chromedriver is initializing chrome binaries but chrome binary not able to sits on the monitor with XVfb .Thats y its throwing error as " Chrome failed to start:exit abnormally"
please follow the below steps before executing ur script.Example:(Execute this cmd in ur Unix server (ex.putty))
usr/bin/Xvfb :2 -ac -screen 0 1280x1024x24 &
export DISPLAY=:2
It will work definitely.