Learn the Handling of Http Authentication Popup Window using Selenium. basic authentication popup windowWhen you are working in a test situation, Platform or Pre Production, there are examples where you may need to work with applications which are verified with authentication popup (Basic Auth).

At whatever point you enter the URL, it will provoke you to enter the User name and the password and it won’t permit executing any further tasks until you give username and password. And, this basic authentication popup window isn’t a JavaScript pop-up; it is a Browser dialog window which selenium can’t deal with simply utilizing a sendKeys strategy which we accomplish for normal JavaScript pop-ups.

To work with basic authentication popup window (which is a browser dialogue window), you simply need to send the user name and password alongside the application URL.

Before we begin, on the most proficient method to handle authentication popup with selenium. We should talk about what the basic authentication popup window is and why it is utilized in applications?

What is Authentication Window?

Authentication is a procedure which is required to get to certain applications in which HTTP verification is utilized for security reason. These are server-side approvals which request authentication beforehand user can access an application. Likewise, known as a basic authentication popup window in ‘web applications where the browser window is utilized to get user credentials. The authentication popup handling came into the image due to security and limiting the unauthorized users in the application.


While automating an application testing through selenium, this issue is commonly faced by a few of us. I have checked this in numerous different sites looking at taking care of pop up window utilizing the installation of AutoIt Tool, Add-ons like AuthAuth, etc.

For what reason is this issue experienced?

How about we discuss more intently why this issue is experienced? While running the automated script on the site it finds the components utilizing the ‘FindElement’ strategy. Since authentication protected applications confine the client to access the web elements. We basically attach username and password in the web application URL, with the goal that it enables the script to locators.

Here is an easy way to overcome this issue. This can be effectively taken care of utilizing the bit of code underneath:

baseUrl=”HTTP://” + username + “:” + password + “@” + URL;

driver.get(baseUrl + “/”);

Utilizing code above we are providing credentials in URL which will include a username and secret key in URL) while running the script it will sidestep the authentication window effectively

In our selenium automation framework, if we utilize the above way to deal with taking care of HTTP authentication popup for password and username, at that point we face an issue, it won’t work.

We investigated to deal with HTTP authentication popup handling in selenium on the latest version of the browser and came up that we can deal with utilizing chrome multipass browser add-ons and utilizing chrome profile

Installation of chrome add-ons:

Open chrome default program and install underneath add-ons.

Open chrome default program and install underneath add-ons. basic authentication popup window

After installation, you should see the screen at the right top corner like on below screen.

Setup the password and user name:

Click on the symbol and enter URL, password, and user name.

Click on the symbol and enter URL password and user name. basic authentication popup window

It will save details in the browser and when you run your test on same browser profile, it will automatically handle and authentication popup will not display.

Setup Profile in Automation Framework:

I’m taking a case of how the Protractor Framework will consequently handle the popup if we call a similar profile in our test and it will execute a test script on a similar browser profile and Authentication.

Open the config.js record of protractor system and include update profile path like beneath:

Capabilities :{

‘browserName’: ‘chrome’,

chromeOptions: {

args: [“user-information dir=C:\\Users\\{UserName}\\AppData\\Local\\Google\\Chrome\\User Data\\Default”],



Now run your test scripts, you should see same profile will open and included add-on will noticeable at upper right corner and authentication pop-up automatically handled.

You can actualize this methodology in other selenium automation structure like java, C# python, and so forth.


Share on: