Search code examples
node.jsgoogle-chromeselenium-webdriverautomationhttp-authentication

How to handle HTTP Basic authentication on Chrome by Protractor?


Can someone help me handle "HTTP basic

authentication prompt" on Chrome?

I can't access the authentication for our staging environment by the regular

method (http://user:password@domain.com).

Do you have any idea how can handle it?
. . .

Technical info:

Programming lang: JavaScript

Framework: Jasmine JS

Browser: Google Chrome (latest)

Platforms: Selenium Webdriver, Node.JS

Runner: Protractor


My code is below:

//First Demo for E2E Automation testing by Protractor for AngularJS

describe ('Do this before every test case', function() {
beforeEach(function() {
    browser.get("http://user:password@domain.com');
    expect(browser.getCurrentUrl()).toEqual("http://wwww.meet2know.com/");
});

var login = require ('../login.js');
});

Solution

  • BrowserMob Proxy might help. I have had luck with it in the past when dealing with basic authentication.