1

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?

sabinonstack
  • 560
  • 5
  • 16
Gobliins
  • 3,382
  • 12
  • 52
  • 97
  • [This answer](https://stackoverflow.com/a/34010150/1906307) explains how to properly wait for `init` to be done. – Louis Aug 28 '17 at 15:41
  • @Louis I am on it. – Gobliins Aug 29 '17 at 08:43
  • @Louis Got it working, question can be deleted / closed if necessary. – Gobliins Aug 29 '17 at 09:27
  • Glad you got it working. Your question was closed as a duplicate 18 hours ago, around the same time I made my comment. It is not *necessary* to delete it. Right now the community cannot delete it anyway. It takes some time after closure before the community can put in deletion votes. If you want to delete it, I think you can since you are the author of the question and it has no answers. – Louis Aug 29 '17 at 10:08

0 Answers0