To handle the authentication popup in protractor, you cannot interact with it directly but you can avoid it by passing the username and password along with the URL. Here is the syntax to do so:
browser.get(protocol://Username:Password@URL Address);
For example:
browser.get(https://selenium:<a href="/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="6a1d0f080e18031c0f182a09020f1809020f18441e0f0902">[email protected]</a>/auth);
Below is a complete program demonstrating how to handle an authentication popup:
describe('Protractor Typescript Demo', function() {
it('Alerts operation', function() {
browser.get("https://selenium:<a href="/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="384f5d5a5c4a514e5d4a785b505d4a5b505d4a164c5d5b50">[email protected]</a>/auth");
browser.getTitle().then(function(title){
if(title == "Authentication Successful"){
console.log("Login successful")
} else {
console.log("Login Failed")
}
})
});
});
If the login is successful, you will see the specific page loaded on the browser.
Adapted from (Authentication Pop Up section)