Last week, I worked on Selenium; not for testing purposes, but for automating a workflow in my project. To automate that workflow, I had to cross a big hurdle - a Windows Authentication popup in between the workflow. I tried everything like appending URL with credentials but nothing worked. At the end, I got to know about autoitx.dotnet NuGet application.
Problem statement
How to authenticate Windows user login when working on Selenium.

Solution
- I am assuming you already have a running project with Selenium.
- Now, go to the NuGet gallery and search for “Autoit” NuGet.

- Install the above NuGet package.
- Now, add the below code where you want to authenticate Windows User Login.
- IWebDriver driver = new InternetExplorerDriver();
- driver.Navigate().GoToUrl("http://localhost/Home/StephenSecrets");
- //Thread.Sleep(500); //if required
- AutoItX.WinWaitActive("Windows Security");
- AutoItX.ControlSetText("Windows Security", "", "Edit1", "TestUser"); //replace testuser with actual username (with domain if required)
- AutoItX.ControlSetText("Windows Security", "", "Edit2", "Password_test"); //replace Password_test with actual Password
- AutoItX.Send("{ENTER}");
- It’s done.
- You can find this sample project on my GitHub repo.
Dhananjay DeshmukhPosted Sep 25, 2019, 6:08 AM
Can you please show upload file using autoitx.dotnet
Hadshana KamalanathanPosted Jul 22, 2018, 4:33 AM
Good one...