Windows authentication?

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

Windows authentication?

Eleo-3
I'm stuck. Cannot use my Selenium tests on the Production site which means I have to live with the Beta site and handle Windows Authentication pop-ups. How does Selenium handle these things?
---------------------------------------------------------------------
Posted via Jive Forums
http://forums.openqa.org/thread.jspa?threadID=5800&messageID=16246#16246

---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

Re: Windows authentication?

sudorp
This post has NOT been accepted by the mailing list yet.
Using selenium you can't do this.

you have to use either AutoIt or Robot java API

Using AutoIt...

install AutoIt and then (Google how to)

Script for IE browser

WinWaitActive("Windows Security","","20")
if(WinExists("Windows Security")) Then
        Send("Selenium_user{TAB}")
        Send("Selenium_Pass{ENTER}")
EndIf

Script For Chrome and FF

WinWaitActive("Authentication Required","","20")
if(WinExists("Authentication Required")) Then
        Send("Selenium_user{TAB}")
        Send("Selenium_Pass{ENTER}")
EndIf

Script for Opera

Send("userName{TAB}")
Send("Password{TAB}")
Send("{ENTER}")


Save this script as .au3 extension
compile this script as 32 bit or 64 bit(as per your System) it will create .exe file
call this .exe in your java class

java code

WebDriver dri ;
System.setProperty("webdriver.chrome.driver", "H:\\username\\Selenium\\Java_Jars\\chromedriver.exe");

dri = new ChromeDriver();
dri.manage().timeouts().implicitlyWait(20, TimeUnit.SECONDS);

Runtime run = Runtime.getRuntime();
Process pro = run.exec("H:\\username\\Selenium\\AutoIT\\HandalWindowAuthenPop.exe");
dri.get("https://website.com");