Error: A session id is required for this command but wasn't found in the response payload

1.7k views Asked by At

I want to do some UI Testing with a Headless Browser Engine. Since we don't have a graphic unit in our Linux I have used docker for chrome

And I setup a test:

const chai = require('chai');
const expect = chai.expect;
const chaiAsPromised = require("chai-as-promised");
chai.use(chaiAsPromised);
const webdriverio = require('webdriverio');
const options = { desiredCapabilities: { browserName: 'chrome' } };

const browser = webdriverio
.remote({ host: 'localhost', port: 4444 })
.init({ browserName: 'chrome', version: '45' });

describe('webdriver.io tests', function() {
  it('is a third test', function() {
    browser.url('foo');
    expect(Promise.resolve(browser.getTitle()))
.to.eventually.equal('foo');
});

Test is run by:

BABEL_ENV=dev npm run mocha-test --recursive=tests/mocha --compilers js:babel-register --require babel-polyfill

But all I get is:

Error: A session id is required for this command but wasn't found in the response payload.

Can anyone help me?

0

There are 0 answers