Selenium does not handle windows pop-ups, applications that uses windows authentication requires login details in the windows pop-up.
You can solve the above problem in 2 ways:
1. sending username/password in url itself.
2. sending username/password from an external source.
Sending username/password from an external source:
Step 1: Download AutoIT tool from
"http://www.autoitscript.com/site/autoit/downloads/"
(AutoIt v3 is a freeware BASIC-like scripting language designed for automating the Windows GUI and general scripting)
"http://www.autoitscript.com/site/autoit/downloads/"
(AutoIt v3 is a freeware BASIC-like scripting language designed for automating the Windows GUI and general scripting)
Step 2: Learn some basic AutoIt tutorial from "http://www.autoitscript.com/autoit3/docs/tutorials/helloworld/helloworld.htm"
Step 3: The below are the AutoIt script to send the authentication details:
selenium = new DefaultSelenium("localhost", 4444, "*firefox", "https://url/");
Process pp=run.exec("path to the .exe file");
Save the above code with extension .au3 and then use “compile script to .exe” tool to convert it to an exe and call it in the selenium code.WinWaitActive("Authentication Required","","20")If WinExists("Authentication Required") ThenSend("username{TAB}")Send("password{Enter}")EndIf
Selenium webdriver code to call the above exe:
Runtime run = Runtime.getRuntime();selenium = new DefaultSelenium("localhost", 4444, "*firefox", "https://url/");
Process pp=run.exec("path to the .exe file");
No comments:
Post a Comment