Skip to content
This repository has been archived by the owner on Feb 26, 2024. It is now read-only.

Issues while running npm run protractor - Timed out waiting for the WebDriver server #439

Open
SaeedMotevalli opened this issue Dec 30, 2018 · 0 comments

Comments

@SaeedMotevalli
Copy link

Sometimes, when i run protracor with following config, i face with {Timed out waiting for the WebDriver server} error. But sometimes it's ok.
selenium standalone and chromedriver is up to date.

Error

[01:21:25] I/launcher - Running 1 instances of WebDriver
[01:21:25] I/local - Starting selenium standalone server...
[01:21:56] E/launcher - Error: Error: Timed out waiting for the WebDriver server at http://192.168.2.89:39865/wd/hub
    at Error (native)
    at onError (/usr/lib/node_modules/protractor/node_modules/selenium-webdriver/http/util.js:102:16)
    at process._tickCallback (internal/process/next_tick.js:109:7)
[01:21:56] E/launcher - Process exited with error code 100

OS
Ubuntu 16.04 LTS (GNU/Linux 4.4.0-141-generic x86_64)

protractor --version

Version 5.4.2

protractor.conf.js :

var basePath = __dirname + '/';
var TestConfig = require(basePath + './test-config');
var LoginPage = require(basePath + '/modules/login.pageObject');

exports.config = {
	//directConnect: true,
	framework: 'jasmine2',
	specs: [basePath + '/**/*.spec.js'],

	capabilities: {
		browserName: 'chrome',
		chromeOptions: {
            args: [
                /*'--headless','--disable-gpu',*/
                // disable chrome's wakiness
                '--disable-infobars',
                '--disable-extensions',
                'verbose',
                'log-path=/tmp/chromedriver.log'
            ],
            prefs: {
                // Disable chrome's annoying password manager
                'profile.password_manager_enabled': false,
                'credentials_enable_service': false,
                'password_manager_enabled': false,
                'download': { // Download configuration
                    'prompt_for_download': false,
                    'directory_upgrade': true,
                    'default_directory': basePath + '.'
                }
            }
        }
	},

	baseUrl: TestConfig.serverUrl,
	allScriptsTimeout: TestConfig.allScriptsTimeout,
	getPageTimeout: TestConfig.getPageTimeout,

    jasmineNodeOpts: {
	    includeStackTrace: true,
    	defaultTimeoutInterval: TestConfig.jasmineDefaultTimeoutInterval
	},

	plugins: [{
		package: 'protractor-screenshoter-plugin',
		screenshotPath: basePath + "./reports/e2e/html-report",
		screenshotOnExpect: 'failure+success',
		screenshotOnSpec: 'failure+success',
		withLogs: true,
		writeReportFreq: 'asap',
		imageToAscii: 'none',
		clearFoldersBeforeTest: true
	}],

	onPrepare: function() {
		protractor.basePath = basePath;
		var width = 1366;
		var height = 1024;
		browser.driver.manage().window().setSize(width, height);
		var x = 0;
		var y = 0;
		browser.driver.manage().window().setPosition(x, y);

        require(basePath + './prototypes/js-prototypes');
        require(basePath + './prototypes/web-element-prototypes');

		var loginPage =  new LoginPage();

		var JasmineReporters = require('jasmine-reporters');
		jasmine.getEnv().addReporter(new JasmineReporters.JUnitXmlReporter({
			savePath: basePath + "./reports/e2e/xml-reports",
			consolidateAll: false
		}));

        var SpecReporter = require('jasmine-spec-reporter').SpecReporter;
        jasmine.getEnv().addReporter(new SpecReporter({
            spec: {
                displayStacktrace: true
            }
        }));

		return global.browser.getProcessedConfig().then(function(config) {});
	}
};
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant