Karma: 'Karma start' fails with 'Cannot load browser 'chrome'

Created on 4 Jun 2017  路  7Comments  路  Source: karma-runner/karma

'karma start' fails with the error:

04 06 2017 22:47:24.132:WARN [karma]: No captured browser, open http://localhost:9876/
04 06 2017 22:47:24.166:INFO [karma]: Karma v1.7.0 server started at http://0.0.0.0:9876/
04 06 2017 22:47:24.169:INFO [launcher]: Launching browser chrome with unlimited concurrency
04 06 2017 22:47:24.173:ERROR [launcher]: Cannot load browser "chrome": it is not registered! Perhaps you are missing some plugin?
04 06 2017 22:47:24.175:ERROR [karma]: Found 1 load error

Environment Details

  • Karma version (output of karma --version): 1.7.0
  • OS: Windows 10

  • Relevant part of your karma.config.js file:

module.exports = function (config) {
config.set({
frameworks: ["qunit"],
files: [
{ pattern: "*.js" },
],
plugins: ['karma-qunit', 'karma-chrome-launcher'],
reporters: ["progress"],
browsers: ['chrome']
});
};

Repro steps: karma start

Most helpful comment

in first config you write 'chrome' instead of the necessary 'Chrome'

All 7 comments

After generating karm.conf.js with 'karma init' the issue is gone. Not sure though i understand what was the problem. Here is my new auto-generated config:

// Karma configuration
// Generated on Mon Jun 05 2017 08:58:15 GMT+0200 (Romance Daylight Time)

module.exports = function(config) {
config.set({

// base path that will be used to resolve all patterns (eg. files, exclude)
basePath: '',


// frameworks to use
// available frameworks: https://npmjs.org/browse/keyword/karma-adapter
frameworks: ['qunit'],


// list of files / patterns to load in the browser
files: [
  '*.js'
],


// list of files to exclude
exclude: [
],


// preprocess matching files before serving them to the browser
// available preprocessors: https://npmjs.org/browse/keyword/karma-preprocessor
preprocessors: {
},


// test results reporter to use
// possible values: 'dots', 'progress'
// available reporters: https://npmjs.org/browse/keyword/karma-reporter
reporters: ['progress'],


// web server port
port: 9876,


// enable / disable colors in the output (reporters and logs)
colors: true,


// level of logging
// possible values: config.LOG_DISABLE || config.LOG_ERROR || config.LOG_WARN || config.LOG_INFO || config.LOG_DEBUG
logLevel: config.LOG_INFO,


// enable / disable watching file and executing tests whenever any file changes
autoWatch: true,


// start these browsers
// available browser launchers: https://npmjs.org/browse/keyword/karma-launcher
browsers: ['Chrome'],


// Continuous Integration mode
// if true, Karma captures browsers, runs the tests and exits
singleRun: false,

// Concurrency level
// how many browser should be started simultaneous
concurrency: Infinity

})
}

in first config you write 'chrome' instead of the necessary 'Chrome'

Closing, please re-open if the above solution didn't work.

karma start
08 08 2018 12:30:02.720:WARN [karma]: No captured browser, open http://localhost:9876/
08 08 2018 12:30:02.732:INFO [karma]: Karma v2.0.5 server started at http://0.0.0.0:9876/
08 08 2018 12:30:02.733:INFO [launcher]: Launching browser Chrome with unlimited concurrency
08 08 2018 12:30:02.753:INFO [launcher]: Starting browser Chrome
08 08 2018 12:30:02.754:ERROR [launcher]: No binary for Chrome browser on your platform.
Please, set "CHROME_BIN" env variable.
/usr/bin/chromium-browser
It's not processing anything
can anyone guide next step?

@SARUNAR execute this line : export CHROME_BIN=/usr/bin/chromium-browse
with it you will indicate the env variable

@EzraBrooks
you need to configurate the karma.conf.js
First install the 'karma-chrome-launcher' plugin
and then add 'Chrome' capitalized to the list of browsers:

module.exports = function (config) {
config.set({
..
plugins: [
..
require('karma-chrome-launcher'),
],
...
browsers: ['Chrome' ]
..
});
};

in first config you write 'chrome' instead of the necessary 'Chrome'

Thanks! It's work for me. I didn't understand that karma is a sensetive case.

Was this page helpful?
0 / 5 - 0 ratings