Hire QA – Specialized in QA Recruitment, Technical Interviews and Testing Solutions

Handling Authentication Window with WebDriver (In Firefox, Chrome and IE)

Category: Selenium WebDriver

To work with Basic Authentication pop-up (which is a browser dialogue window), you just need to send the user name and password along with the application URL.

#1 (Chrome & Firefox)
By passing user credentials in URL. Its simple, append your username and password with the URL.

e.g., http://Username:Password@SiteURL

http://rajkumar:myPassword@www.softwaretestingmaterial.com

#2 (IE)
First create AutoIt script as below and save it as basicauth.au3

To pass user name and password
WinWaitActive(“Windows Security”)
Send(“admin”)
Send(“{TAB}”)
Send(“admin”)
Send(“{ENTER}”)
————————————————–
try {
Runtime.getRuntime().exec(“G:/basicauth.exe”);
} catch (Exception e) {
e.printStackTrace();
}

Leave a Reply

Your email address will not be published. Required fields are marked *