Handle Windows Authentication Popup using Selenium Webdriver

package com.zedo.Testing;

import java.io.IOException;

import org.openqa.selenium.WebDriver;
import org.openqa.selenium.firefox.FirefoxDriver;

public class AutoITScriptHandler {

	public static void main(String[] args) throws IOException 
	{
		WebDriver driver = new FirefoxDriver();
		
		driver.manage().window().maximize();
		
		Runtime.getRuntime().exec("D:\\Scripts\\AutoITScript\\HandleAuthentication.exe");
		
		driver.get("https://www.engprod-charter.net/");

	}

}

AutoITScript:

WinWaitActive("Authentication Required")
Send("validusername")
Send("{TAB}")
Send("validpassword")
Send("{ENTER}")

 

Leave a Reply

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