R
R
Ramil2017-04-20 08:10:55
Software testing
Ramil, 2017-04-20 08:10:55

How to properly setup Selenium for WebdriverIO?

I'm trying to run functional tests on Webdriverio on my local machine, and when I run the tests, I get an error:

no such session
  (Driver info: chromedriver=2.28.455520 (cc17746adff54984afff480136733114c6b3704b),platform=Windows NT 10.0.10586 x86_64) (WARNING: The server did not provide any stacktrace information)
Command duration or timeout: 4 milliseconds
Build info: version: '3.3.1', revision: '5234b32', time: '2017-03-10 09:04:52 -0800'
System info: host: 'WORKPC', ip: '192.168.1.38', os.name: 'Windows 10', os.arch: 'x86', os.version: '10.0', java.version: '1.8.0_65'
Driver info: org.openqa.selenium.chrome.ChromeDriver
Capabilities [{message=unknown error: cannot find Chrome binary
  (Driver info: chromedriver=2.28.455520 (cc17746adff54984afff480136733114c6b3704b),platform=Windows NT 10.0.10586 x86_64), platform=ANY}]
Session ID: ab5e4cf0ae668ab0a68849a648def5e6

Judging by the error, Selenium cannot find something in ChromeDriver. What could be the problem? Someone faced this problem?
My installation and configuration steps:
  1. Installed packages
    npm i -g selenium-standalone webdriverio
  2. Launched Selenium
    selenium-standalone install && selenium-standalone start

  3. Set up Webdriveriowdio config
  4. Run testswdio -c wdio.conf.js

Contents of the wdio.conf.js file
exports.config = {
    specs: [
        './test/**/*.js'
    ],
    maxInstances: 10,
    capabilities: [{
        maxInstances: 5,
        browserName: 'chrome'
    }],
    sync: true,
    logLevel: 'verbose',
    coloredLogs: true,
    bail: 0,
    screenshotPath: './test/error-shots',
    baseUrl: 'http://localhost:3000',
    waitforTimeout: 10000,
    connectionRetryTimeout: 90000,
    connectionRetryCount: 3,
    services: ['selenium-standalone'],
    framework: 'mocha',
    reporters: ['dot'],
    mochaOpts: {
        ui: 'bdd'
    }
}

As an example, I'm trying to run such a test, taken from the office. webdriverio site:
describe('DuckDuckGo search', function() {
  it('searches for WebdriverIO', function() {
    browser.url('https://duckduckgo.com/');
    browser.setValue('#search_form_input_homepage', 'WebdriverIO');
    browser.click('#search_button_homepage');
    var title = browser.getTitle();
      console.log('Title is: ' + title);
      // outputs: "Title is: WebdriverIO (Software) at DuckDuckGo"
    });
});

Answer the question

In order to leave comments, you need to log in

1 answer(s)
G
gill-sama, 2017-04-20
@rshaibakov

webdriver.io/guide.html
You probably missed that you need to install a driver for the browser in which you will be testing.
https://sites.google.com/a/chromium.org/chromedriv... - chromium driver
https://github.com/mozilla/geckodriver/releases - for ff
Selenium can't do it without a driver

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question