1

This issues stems around Selenium, Jenkins, NUnit on a C# platform.

I have an application that calls a windows auth box for login. I ended up using Autoit to login and everything works great locally. When this is executed from Jenkins though, everything fails. I made some changes to the autoit script and my current failure is "Modal dialog present". (I used WinWait vs WinWaitActive)

My guess is that the exe is not being run when launched from Jenkins. Permissions Issues?

Jenkins is running on Windows 2012 R2 as a Master

C# code: System.Diagnostics.Process.Start(Path.Combine(base.BasePath, @"folder\autoitfile.exe"));

Anyone have ideas on what may be causing this?

Thanks!

1
  • did you get a solution to this. I am in same situation, if you have a solution can you please help me. Commented Feb 3, 2016 at 6:50

2 Answers 2

1

I had the same problem. It turned out that in my case the window did not appear and the script kept waiting. I added the timeout parameter to the WinWaitActive method call, and now my script does not hang anymore. Also I had to let the active thread sleep for a while to be sure the user was logged in.

public void Login(string username, string password, int waitForit)
{
    AutoItX.WinWaitActive(title: "Windows Security", timeout: 15);
    AutoItX.Send(username);
    AutoItX.Send("{TAB}");
    AutoItX.Send(password);
    AutoItX.Send("{ENTER}");

    Thread.Sleep(waitForit);
}

Hope this helps fixing your problem.

Sign up to request clarification or add additional context in comments.

Comments

0

When manipulating external application windows, always use #RequireAdmin in order to get the permission elevation. Also use Opt("WinSearchChildren", 1) in order to search child windows too. Play with "WinTitleMatchMode"

#RequireAdmin ;Will give your script a permission elevation (sometimes its needed)
Opt("WinTitleMatchMode", 2) ;1=start, 2=subStr, 3=exact, 4=advanced, -1 to -4=Nocase
Opt("WinSearchChildren", 1) ;0=no, 1=search children also

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.