Search code examples
angularjsseleniumtestingprotractorwebdriver-manager

how do you start webdriver-manager start in the Config file


I'm trying to get my config file to the point where I don't have to go to the mac terminal and type webdriver-manager start. Is it possible to have the config file do that? I have listed my code below to give you idea what I have set up. I just don't know if it is possible. Let me know. I am on a macbook pro.

exports.config = {

    seleniumServerJar: './selenium/selenium-server-standalone-2.45.1.jar',

    seleniumPort: null,

    chromeDriver: './selenium/chromedriver.exe',
    chromeDriver: null,


    seleniumAddress: 'http://localhost:4444/wd/hub',


    // ----- What tests to run -----

    suites: {
        CSRSmokeTest: '../smoke/deskTop/CSR.js'
        DesktopSmokeTest: '../smoke/deskTop/**.js'
    },

    chromeOnly: false,

    multiCapabilities: [
        {
            'browserName': 'chrome',
            'chromeOptions': {
                args: ['--lang=en',
                    '--window-size=1900,1200']
            }
        },

    ],

    baseUrl: location + '/login/#/login',
    rootElement: 'body',

    onPrepare: function () {
        browser.ignoreSynchronization = true;
        browser.get(location + '/login/#/login');
    },
    params: {
        user: {

            //TEST******************************************


        },
        url: {

            //some code

        }

    },

    jasmineNodeOpts: {
        // onComplete will be called just before the driver quits.
        onComplete: null,
        // If true, display spec names.
        isVerbose: true,
        // If true, print colors to the terminal.
        showColors: true,
        // If true, include stack traces in failures.
        includeStackTrace: true,
        // Default time to wait in ms before a test fails.
        defaultTimeoutInterval: 6000000
    }
};

Solution

  • If you just do not want to type in terminal you have several options:

    1. Leave only seleniumServerJar option, and remove seleniumAddress. But starting Selenium everytime takes additionally 5-20 sec (depending on the hardware).
    2. Use directConnect: true for Chrome. And then you do not need Selenium server at all. It works for me, but it is not fully portable solution.
    3. Install Selenium somewhere on your server and leave it running forever. In this case your application should have publically accessible URL, so not just localhost.