2
votes

I am using CI Jenkins Tool and trying to execute an AUTO IT Exe file.

I tried through Jenkins, with the following options, but nothing is working out.

  1. Execute command line arguments

  2. batch file

  3. ant file

  4. Windows runner plugin

2

2 Answers

5
votes

Running AutoIt via Jenkins on a slave will depend on how the slave is launched. Since you're using AutoIt, you're using Windows. The Windows slave can NOT be started via SSH or via Windows Service. You MUST use JNLP Web State and you MUST start it in a particular way for AutoIt to work properly.

To get AutoIt to work, the slave must first has a user logged in and at a desktop. You can do this manually, or set Windows to auto-login on startup.

Once at the desktop, the JNLP web start method must be used. This usually means downloading the slave.jar from the Jenkins server via curl, then launching java with the slave and pointing to the jnlp file on the Jenkins side. Preferably, you'll want to automate this via the Scheduler, but you can do it manually too. See here for an example: https://wiki.jenkins-ci.org/display/JENKINS/Launch+Java+Web+Start+slave+agent+via+Windows+Scheduler

Once you get the slave connected in this fashion, a job targeted at this slave that runs AutoIt should work.

NOTE: Given the nature of AutoIt, you can't run it on the master node because the master node never has desktop access that AutoIt needs. You can setup a slave agent on the master node to get around the limitation.

-1
votes

The only reason when You invoke you code from Jenkins, Invoked AutoIt cannot find the required window in slave/execution Jenkins machine.

Solution: Write your AutoIt script and manually invoke it execution machine, handle the window Pop.