we are currently using Katalon with katalon runtime engine, running tests through CLI with Jenkins.
We use virtual machine with windows for running these tests.
Our CRM system is in MS Dynamics 365 and windows auth (NTLM) is used as log-in. So in case eligible windows user opens the page, he is logged automatically, otherwise, Windows auth windows appears.
I tried several ways of implementing login methods so far, but I have troubles inserting the credentials when I try to run them automatically in Jenkins.
I tried AutoIT script, executed with Runtime.getRuntime().exec(), I tried using clipboard (Toolkit.getDefaultToolkit().getSystemClipboard()) and ctrl+c and ctrl+v and I tried the dumbest one, pressing every key of credentials with Robot class
All these ways work OK when I try them locally, even when I log on this virtual machine where we run Jenkins and I run them with Katalon or through CLI, it’s all OK. But from Jenkins, the first two methods fails totally, and the dumb method fails because language of the keyboard on the server is not english probably.
Failed tests doesn’t show any particular error, script works, but it’s unable to insert credentials so it ends with timeout.
I guess that my possibilities now are to try to change keyboard on the machine (but that is not a way I want to go, since the solution is ugly and a bit dumb) or to try to find out if the tests are running under some windows user and add this user to active directory, so the credentials would be taken from the win user. But in a corporate this is a bit lenghty and difficult way.
Does anybody experienced something similar, or have an idea where could be the problem? Thanks.
Problem to solve: I have windows auth window when I try to log into the application. (the “alert” with login, looks like browser alert, but it is Windows security window)
Starting conditions: I run the tests on Windows VM, through Jenkins, with Katalon Runtime Engine and Katalon Jenkins plugin.
I tried multiple methods how to input into this win auth. AutoIT script, Ctrl+v with clipboard, pressing the keys with Robot class.
When I try to run these tests locally, all of these methods works.
But when I try to run them with my setup (see “Starting conditions”), they all fail.
I would like the AutoIT or the clipboard to work, but I suppose that the ability to call operating system tools (CLI, clipboard) from the test which is running like this, is somehow limited.
in case this is still open for you or someone else lands here. autoit, robot and the clipboard all fail on jenkins for the same reason: the jenkins agent runs as a windows service, so it lives in session 0, which has no interactive desktop. there is no window there for autoit to type into, even though chrome renders fine. it works locally because your session has one.
two fixes, pick one.
the clean one: do not let the windows security dialog appear at all. run the jenkins agent as the ad account that is allowed into dynamics, and tell chrome to do integrated auth for that host. Project > Settings > Desired Capabilities > Chrome:
name: args type: List value: ["--auth-server-allowlist=*.yourcompany.com", "--auth-negotiate-delegate-allowlist=*.yourcompany.com"]
chrome then answers the ntlm challenge with the running account’s credentials, same as a user who is “logged automatically”, no dialog.
the quick one: stop running the agent as a service. log in to the vm with the test account, auto-logon it, and start the agent from that session (the jnlp / java -jar agent.jar way, or a scheduled task “run only when user is logged on”). now autoit and robot have a real desktop and your existing code works unchanged.