AutoItX4Java - Java AutoIt Bridge

AutoIt is a very useful automation scripting language for Microsoft Windows. It allows for GUI automation using a very simple syntax and can be useful for testing applications. It is packaged with AutoItX which supports accessing AutoIt functions through COM objects.

I just created a new project on Google Code for Java AutoItX bindings. The project is called AutoItX4Java and uses the JACOB Java COM Bridge to access AutoItX functions. Currently the project is in an unstable state but hopefully as time goes on things will get better tested.

Using AutoItX4Java is simple:
  1. Download JACOB.
  2. Download and install AutoIt. (or register the dll. See below)
  3. Add jacob.jar and autoitx4java.jar to your library path.
  4. Place the jacob-1.15-M4-x64.dll file in your library path.

A simple example of using this library is below:
        File file = new File("lib", "jacob-1.15-M4-x64.dll"); //path to the jacob dll
        System.setProperty(LibraryLoader.JACOB_DLL_PATH, file.getAbsolutePath());

        AutoItX x = new AutoItX();
        String notepad = "Untitled - Notepad";
        String testString = "this is a text.";"notepad.exe");
        Assert.assertTrue(x.winExists(notepad, testString));
        x.winClose(notepad, testString);
        Assert.assertFalse(x.winExists(notepad, testString));
Troubleshooting: Be sure to use the correct version of the Jacob and AutoItX3 dlls. Both come in x86 and x64 versions.

If you need to test whether AutoItX is setup, just enter powershell and do the following:
$x = New-Object -comObject "AutoItX3.Control"
If that does not work ensure the AutoItX3.dll is loaded.
regsvr32.exe AutoItX3.dll
regsvr32.exe AutoItX3_x64.dll
You will also have to be in the x64 version of powershell for this test to work.

If your program never stops you can control how Jacob threading works as described here:
        AutoItX x = new AutoItX();"calc.exe");


  1. Hi, Very nice explanation. However where i can download required autoitjar file?

    1. i am getting below error.
      java.lang.UnsatisfiedLinkError: Can't load library: C:\WINDOWS\system32jacob-1.15-M4-x64.dll
      at java.lang.ClassLoader.loadLibrary(

      Please advice

  2. Could you give the sources of jar?

    1. you can check

  3. how do I automate Excel (Open/Edit/Close) using autoitx4java in eclipse

  4. This comment has been removed by the author.

  5. This comment has been removed by the author.


Post a Comment

Popular posts from this blog

The SQL Server and .Net equivalent of PHP and MySQL's SHA1 function

Easy .NET MVC Active Directory Attribute Based Authorization