Protractor : browser.get() doesn't function

1.7k Views Asked by At

I am a newbie using protractor for angularjs app e2e testing. I have the latest version of protractor setup and using Visual studio 2015 as the IDE.

The function browser.get() mentioned in my tests doesn't work and only opens up a browser window with "Data:,".

Here is my config.js file :

'use strict';
exports.config = {
        directConnect: true,
        chromeDriver: './node_modules/protractor/selenium/chromedriver.exe',

    // Capabilities to be passed to the webdriver instance.
    capabilities: {
        'browserName': 'chrome'

    },

    // Spec patterns are relative to the current working directly when
    // protractor is called.
    specs: ['example_spec.js'],
    framework: 'jasmine',

    // Options to be passed to Jasmine-node.
    jasmineNodeOpts: {
        showColors: true,
        defaultTimeoutInterval: 30000
    },

    onPrepare: function () {
        browser.driver.manage().window().maximize();
    }
};

Here is my spec.js file :

describe('angularjs homepage', function () {
    it('should have a title', function () {
      browser.get('http://angularjs.org/');

        expect(browser.getTitle()).toContain('AngularJS');
    });
});

Am i missing out on anything? Please help! i have been trying to fix this since 3 days now.

1

There are 1 best solutions below

7
On

The first thing,

chromeDriver: './node_modules/protractor/selenium/chromedriver.exe'

is not needed.Your web-driver manager manage it.

If your protractor version is >3.0  then install node > 4.0.

UPDATE :

Please fire following command :

webdriver-manager update