Question

I'm trying to run this on a Windows machine and keep getting a timeout. I have Selenium running but it seems like its not able to fulfill connecting to the URL.

var client = require('webdriverjs').remote({
    desiredCapabilities: {
        browserName: 'chrome'
    },
    logLevel: 'verbose'

});
var expect = require('chai').expect;


describe('Test example.com', function(){
    before(function(done) {
        client.init().url('http://example.com', done);
    });

    describe('Check homepage', function(){
     it('should see the correct title', function(done) {
        client.getTitle(function(err, title){
            expect(title).to.have.string('Example Domain');
            done();
        });
    });

    });

    after(function(done) {
        client.end();
        done();
    });
});

This is the error I receive:

  1) Test example.com "before all" hook:
     Error: timeout of 10000ms exceeded
      at null.<anonymous> (C:\Users\sandy_000\AppData\Roaming\npm\node_modules\m
ocha\lib\runnable.js:139:19)
      at Timer.listOnTimeout [as ontimeout] (timers.js:110:15)
Was it helpful?

Solution

I found this website: http://aboutcode.net/2013/12/02/automating-chrome-on-windows-with-javascript-using-selenium-webdriverjs.html

I needed to download the associating executable driver and start selenium with it like so:

c:\myproject>java -jar selenium-server-standalone-2.35.0.jar -Dwebdriver.chrome.driver=chromedriver.exe
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top