Felix Walne
Felix Walne

Reputation: 11

Windows 10 - IE 11 Windows Secruity Popup - AutoIT returns no control information

I am updating a C# Test Framework that uses Selenium webdriver for browser testings. Upon starting each testcase, I need to bypass the Windows Secruity Popup (IE11 : v11.187.14393.0) in order to get onto the development site i am testing. I have had this working previously using AutoIt with the following code.

      AutoItX3 autoIt = new AutoItX3();
      string windowTitle = "Windows Security";

      // Wait 30 seconds max...
      autoIt.WinWait(windowTitle, string.Empty, 30);

      // Need to wait for input fields to load...
      Thread.Sleep(2000);

      autoIt.WinActivate(windowTitle);
      autoIt.ControlSetText(windowTitle, string.Empty, "[CLASS:Edit; INSTANCE:1]", username);
      autoIt.ControlSetText(windowTitle, string.Empty, "[CLASS:Edit; INSTANCE:2]", password);
      autoIt.ControlClick(windowTitle, "OK", "[CLASS:Button; INSTANCE:2]");
      autoIt.WinWaitClose(windowTitle, string.Empty, 10);

I have since updated my OS to windows 10 and the popup box has since changed (See below)

See new security popup example

See old secruity popup example

The AutoIt inspector no longer returns any control information for any object within the secruity popup window, so i am unable to interact with them. (See below what he inspector returns for the username inputbox)

Window <<<< Title: Windows Security Class: Credential Dialog Xaml Host Position: 732, 354 Size: 456, 386 Style: 0x96C80000 ExStyle: 0x00200100 Handle: 0x00000000015B1204

Control <<<< Class:
Instance:
ClassnameNN:
Name:
Advanced (Class):
ID: Text:
Position:
Size:
ControlClick Coords:
Style:
ExStyle:
Handle:

Mouse <<<< Position: 816, 548 Cursor ID: 0 Color: 0xF0F0F0

StatusBar <<<<

ToolsBar <<<<

Visible Text <<<<

Hidden Text <<<<

I have tried to point AutoIt at the active window and send keys directly but this isnt working either. (See below code).

        string windowTitle = "Windows Security";

        // Wait 30 seconds max...
        autoIt.WinWait(windowTitle, string.Empty, 30);

        // Need to wait for input fields to load...
        Thread.Sleep(2000);

        autoIt.WinActivate(windowTitle);
        autoIt.Send(username);
        autoIt.Send(Keys.Tab.ToString());
        autoIt.Send(password);
        autoIt.Send(Keys.Enter.ToString());
        autoIt.WinWaitClose(windowTitle, string.Empty, 10);

Does anyone have any ideas how I can get past this?

Thanks

Upvotes: 1

Views: 2283

Answers (1)

Max Young
Max Young

Reputation: 1662

The new dialogue is XAML. AutoIt will only work with Win32 applications. If you want to interact with that dialogue I would suggest using UI Automation. If you still want to use AutoIt you could attempt to use it to send windows messages to the controls directly but you will need to use another tool to get the IDs of the controls. This forum suggests a AutoIt script for sending the windows messages and I suggest Inspect.exe which comes with the Windows SDK. Inspect.exe is the tool that replaced UiSpy which is mentioned in that forum post.

At my company we had to switch to UI Automation from AutoIt when we went from a VB6 application to a WPF application.

Upvotes: 1

Related Questions