How to Handel AD Authentication Dialog to access web application Selenium by integrating selenium with Auto IT

AD authentication dialog is not a we control so selenium would never recognize this therefore you need third party application source and open source solution is auto it .

1. Download AutoIT tool. It can be downloaded from

Note: Please download AutoIT Full Installation

2. While installing AutoIT, you will get two options: Run the Script and Edit the Script. If you are going to use the script without any modification, choose Run the Script option. If you want to customize the scripts, choose Edit the Script option (Recommended as we always needs to customize the scripts for our needs. Sometimes we need to create our own scripts.)
3. Open the place where auto it is installed

4. Open Extras folder and then open Recorder for auto it script

5. Open FF or Chrome
6. Open the URL which shows AD authentication dialog . When Dialog appears click record button on auto it
7. Enter username and password and then click login
8. Stop recording
9. Verify script is generated
10. Save script as e.g  loginFF on desktop
11. Left click on saved click left click on it

12 click compile script now you have created an exe you can run it in your selenium script
11 call it in your script like the code below
public void handleADauthenticaitonDialog() 

        WebDriver driver = new FirefoxDriver();
**any URL**);
         Process pp=run.exec(“YoueDrive PATH\\LoginFF.exe”);

Selenium will invoke the Login FF .exe


Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s