Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Protractor not working in google chrome

I am new to protractor testing tool in angular js, I installed CORS extension in chrome browser, I wrote my first test-case, I try to run this using 'protractor config.js' chrome browser is getting open, actually it is login form, i entered correct username and password but it is not connecting to server, I understood that CORS extension was disabled, how to enable cors extension when i am running test case through cmd.

my config.js

exports.config = {
    capabilities: {
          // You can use other browsers
          // like firefox, phantoms, safari, IE (-_-)


            'browserName': 'chrome'
    },
    specs: [
           // We are going to make this file in a minute
        '../www/modules/user/login.spec.js',
        //'../www/modules/lead/list.spec.js',

    ],
    jasmineNodeOpts: {
        showColors: true,
        //defaultTimeoutInterval: 30000,
        isVerbose: true,
    },
    allScriptsTimeout: 20000,
    onPrepare: function(){
        browser.driver.get('http://localhost:8100/');
    }
};
like image 576
tvtv Avatar asked Jul 12 '26 11:07

tvtv


1 Answers

By default, a completely clean browser is fired up with no extensions installed.

In order to start Chrome with an extension, you need to set the chromeOptions and the extensions appropriately. Here you can find working samples:

  • Is it possible to add a plugin to chromedriver under a protractor test?
like image 199
alecxe Avatar answered Jul 15 '26 01:07

alecxe



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!