question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Error: ChromeDriver did not start within 5000ms

See original GitHub issue

I’m trying to run the getting started script from here (slightly modified).

const Application = require("spectron").Application;
const path = require("path");
const assert = require("assert");

const electronPath = require("electron");
const appPath = path.join(__dirname, "..");

const app = new Application({
  path: electronPath,
  args: [appPath]
});

describe("application launch", function () {
  this.timeout(15000);

  beforeEach(function () {
    return app.start();
  });

  afterEach(function () {
    if (app && app.isRunning()) {
      return app.stop();
    }
  });

  it("shows an initial window", function () {
    return app.client.getWindowCount().then(function (count) {
      assert.equal(count, 1);
    });
  });
});

I’ve tried to run this script but I’m getting following error

bash-3.2$ ./node_modules/.bin/mocha ./test/main.js 


  application launch
    1) "before each" hook for "shows an initial window"


  0 passing (6s)
  1 failing

  1) application launch "before each" hook for "shows an initial window":
     Error: ChromeDriver did not start within 5000ms
      at Error (native)
      at node_modules/spectron/lib/chrome-driver.js:63:25
      at Request._callback (node_modules/spectron/lib/chrome-driver.js:121:45)
      at Request.self.callback (node_modules/request/request.js:186:22)
      at Request.<anonymous> (node_modules/request/request.js:1081:10)
      at IncomingMessage.<anonymous> (node_modules/request/request.js:1001:12)
      at endReadableNT (_stream_readable.js:974:12)
      at _combinedTickCallback (internal/process/next_tick.js:74:11)
      at process._tickCallback (internal/process/next_tick.js:98:9)

I’m on osx 10.11 with

  • Electron 1.4.8
  • Spectron 3.4.0
  • Mocha 3.1.2
  • node 6.5 and npm 3.10

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Reactions:3
  • Comments:24

github_iconTop GitHub Comments

17reactions
HaNdTriXcommented, Jan 16, 2019

I had a similar problem, after switching from mocha to ava. Reinstalling all node_modules solved the issue for me.

yarn install --force
13reactions
Siilwyncommented, Jan 5, 2017

Alright I solved it on my end by installing display server related packages that are needed for chrome driver to run.

    # Install display server dependencies
    - "apt install xvfb libxtst6 libxss1 libgtk2.0-0 -y"
    # Install core libraries for chromium driver
    - "apt install libnss3 libasound2 libgconf-2-4 -y"

Think I’m going to find and try a docker image that already has the required chrome driver dependencies. Finally solved! 🎉

Read more comments on GitHub >

github_iconTop Results From Across the Web

Error: ChromeDriver did not start within 5000ms - Stack Overflow
I just removed that runner and started fresh one. New Runner downloaded Spectron and ChromeDriver on start and Chrome worked.
Read more >
Fixing error: “chromedriver” cannot be opened because the ...
Solution: 1) Find a path to chromedriver binary; 2) Tell MacOS to trust the binary by lifting the quarantine via the following command......
Read more >
Error: ChromeDriver did not start within 5000ms - Bountysource
I'm trying to run the getting started script from here (slightly modified). const Application = require("spectron").
Read more >
Test an Electron app with selenium webdriver - Intellipaat
The connection with chromedriver is not working, when I launch the test and try click a simple button I get ... classSelector")).click(); }) ......
Read more >
angular/protractor - Gitter
but it does not seems to understand typescript in the plugin code ... but to no effect same error ... Failed: ChromeDriver did...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found