Thursday, 16 March 2017

Running node js selenium test case on Chrome get Error Error: ECONNREFUSED connect ECONNREFUSED 127.0.0.1:63528

Running a test case on selenium node js got error Error: ECONNREFUSED connect ECONNREFUSED.

Test case

var assert = require('assert'),
    test = require('selenium-webdriver/testing'),
    webdriver = require('selenium-webdriver');
test.describe('Google Search', function () {
    test.it('should work', function (done) {
        this.timeout(100000);
        var driver = new webdriver.Builder().withCapabilities(webdriver.Capabilities.chrome()).build();
        driver.get('http://www.google.com');
        var searchBox = driver.findElement(webdriver.By.name('q'));
        searchBox.sendKeys('simple programmer');
        searchBox.getAttribute('value').then(function (value) {
            assert.equal(value, 'simple programmer');
        });
        driver.quit();
        done();
    });
});

And the error stack trace as follows

Error: ECONNREFUSED connect ECONNREFUSED 127.0.0.1:63528 at ClientRequest. (node_modules\selenium-webdriver\http\index.js:238:15)



via Megha P Augustine

No comments:

Post a Comment