How to handle Widows Security Pop-Up Window

4,812 views
Skip to first unread message

Mayank Srivastava

unread,
Jan 21, 2013, 8:02:49 AM1/21/13
to seleniu...@googlegroups.com
Hi,

I have website which is used for internal purpose and to access that user has to enter internal credentials.

Whenever user start that website, system opens up a Windows Security pop-up window with Username, Password, and Login button.

I'm using WebDriver.
How to handle this pop-up window?

Regards,
Mayank

Michael Wowro

unread,
Jan 21, 2013, 12:14:45 PM1/21/13
to seleniu...@googlegroups.com
Hi Majank,

as it sounds to me the window comes from operating system - then you can't reach it with WebDriver at all. WebDriver only support you in browser automation. Try to figure out why Windows sends this popup and suppress it.

Yours Michael

H D

unread,
Jan 22, 2013, 4:36:29 AM1/22/13
to seleniu...@googlegroups.com
Mayank - you need to enter the user id and password as part of the URL, like





--
You received this message because you are subscribed to the Google Groups "Selenium Users" group.
To post to this group, send email to seleniu...@googlegroups.com.
To unsubscribe from this group, send email to selenium-user...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msg/selenium-users/-/kONWcQHAhqgJ.
For more options, visit https://groups.google.com/groups/opt_out.
 
 

Message has been deleted

Mark Collin

unread,
Jan 22, 2013, 5:19:01 AM1/22/13
to seleniu...@googlegroups.com
This won't work on all browsers.

IE disabled the ability to do that a while back and I don't think Safari supports it.

Mayank Srivastava

unread,
Jan 22, 2013, 6:54:07 AM1/22/13
to seleniu...@googlegroups.com
Guys,

As I did not get any appropriate way to solve that, so taken shortcut to solve the problem. :-)

Below is the code to enter username and password in Windows Authentication Dialog-

        InternetExplorerDriver brow = new InternetExplorerDriver();
        brow.get("http://qa.xxxx.xx.xxxx.com/sites/abc/Home.aspx");
       
       
        //Code to handle Basic Browser Authentication in Selenium.
        Alert aa = brow.switchTo().alert();
        aa.sendKeys("username");  
       
        Robot a = new Robot();
        a.keyPress(KeyEvent.VK_ENTER);
        a.keyPress(KeyEvent.VK_ENTER);
       
        Thread.sleep(5000);
       
        Alert bb = brow.switchTo().alert();
        bb.sendKeys("password");
   
        a.keyPress(KeyEvent.VK_ENTER);
        a.keyPress(KeyEvent.VK_ENTER);


First it's enter the username in first edit field then hitting the enter key which makes the system to point the second edit field. Now it will data in second edit field and hit the enter which makes the system to login through that authentication.

Regards,
Mayank

Mahesh Munegowda

unread,
May 15, 2014, 1:42:23 AM5/15/14
to seleniu...@googlegroups.com
Hi Mayank,

  I hope by this time you would have got the solution foe this issue, the best way is to use autoit exe file.

Thanks,
Mahesh M
Reply all
Reply to author
Forward
0 new messages