I tried login to firefox authentication window by following code :
WinWaitActive("Authentication Required","","120")
If WinExists("Authentication Required") Then
Send("username{TAB}")
Send("password{Enter}")
EndIf
But the same dint worked for chrome even though it has the same title as firefox.
Any idea?
A lot of credit for this goes to @CristiG for this.
Cristi's method didn't work for me, because the call to GoToUrl() blocks when the login dialog box pops up. But that can be fixed simply by starting a thread to do the login before calling GoToUrl(). It would seem you could use either WinWait() or WinWaitActive() to eliminate the need for the Thread.Sleep(), but I couldn't get either to work, so I was left with the ugly Thread.Sleep(), but this approach works for me.
If somebody is interested in Selenium for Chrome using Visual Studio and NUnit Framework, you can follow these steps:
Install AutoItX.Dotnet NuGet package for your testing project
Write the following code:
and you are logged in your web application.
@Milos @Samoth thanks for spending to solve my query.
Using Autoit windows info tool, i could not identify the windows tile in chrome thats not a case in FF or IE. Instead of that "Autentication Required" identified as visible text.
So modifying the code to
did the trick for Chrome browser.