1 Star 0 Fork 0

张治强/autoitx4java

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
贡献代码
同步代码
取消
提示: 由于 Git 不支持空文件夾,创建文件夹后会生成空的 .keep 文件
Loading...
README

#AutoItX4Java

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 Windows applications. It is packaged with AutoItX which supports accessing AutoIt functions through COM objects.

AutoItX4Java uses JACOB to access AutoItX through COM and strives to provide a native Java interface while maintaining the simplicity of AutoIt. Getting started is simple.

  1. Download JACOB.
  2. Download and install AutoIt.
  3. Add jacob.jar and autoitx4java.jar to your library path. Note that this project (autoitx4java.jar) is comprised of one code file so you can alternatively just include AutoItX.java in lieu of autoitx4java.jar.
  4. Place the jacob-1.15-M4-x64.dll file in your library path.
  5. Start using AutoItX.

###Example

        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 test.";
        x.run("notepad.exe");
        x.winActivate(notepad);
        x.winWaitActive(notepad);
        x.send(testString);
        Assert.assertTrue(x.winExists(notepad, testString));
        x.winClose(notepad, testString);
        x.winWaitActive("Notepad");
        x.send("{ALT}n");
        Assert.assertFalse(x.winExists(notepad, testString));

####Troubleshooting

Both AutoItX3 and Jacob dll's come in x86 and x64 versions. Ensure you use the correct dlls.

If AutoItX isn't disposing itself properly make a call to ComThread.Release() when you are done using AutoItX. Refer to JACOB documentation: JacobThreading and Object Lifetime

####Note

If you do not want to install AutoIt, you can just grab AutoItX3.dll and register it with: regsvr32.exe AutoItX3.dll

AutoItX4Java is comprised of one file so you can either use the jar or copy the .java file into your source.

If you get errors like: "Can’t co-create object" then ensure you have the AuotItX dll registered. If you need to manually register the 64 bit version, use: "\Windows\SysWOW64\regsvr32.exe AutoItX3_x64.dll" otherwise use "regsrv32.exe AutoItX3.dll".

####Warning

AutoItX4Java is not completely tested. Use at your own risk.

空文件

简介

Automatically exported from code.google.com/p/autoitx4java 展开 收起
取消

发行版

暂无发行版

贡献者

全部

近期动态

不能加载更多了
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
Java
1
https://gitee.com/jeffzhangzhiqiang/autoitx4java.git
git@gitee.com:jeffzhangzhiqiang/autoitx4java.git
jeffzhangzhiqiang
autoitx4java
autoitx4java
master

搜索帮助