用于 Windows 应用程序自动化的优秀 Java 库

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/3776427/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-15 15:18:03  来源:igfitidea点击:

Good java library for Windows application automation

javawindowsautomation

提问by Skarab

I am looking for a best way to trigger windows application automation from Java application. So far I have been using Groovy and Scriptom library to access COM native interface. It is rather straight forward approach, but does not scale well (writing configuration for each of application, reading brilliant COM documentations, testing, testing etc.)

我正在寻找一种从 Java 应用程序触发 Windows 应用程序自动化的最佳方法。到目前为止,我一直在使用 Groovy 和 Scriptom 库来访问 COM 本机接口。这是相当直接的方法,但不能很好地扩展(为每个应用程序编写配置、阅读精彩的 COM 文档、测试、测试等)

I am looking now for better way to automate windows application from Java application. Is there any java library that could help me? Maybe I should use a non-java framework, e.g., autoit, and call it from Java?

我现在正在寻找更好的方法来从 Java 应用程序自动化 Windows 应用程序。有没有可以帮助我的Java库?也许我应该使用非 Java 框架,例如autoit,并从 Java 中调用它?

采纳答案by Tomas Narros

You can use the JACOB (Java-COM Bridge) project.

您可以使用JACOB (Java-COM Bridge) 项目

It's a Java library that uses JNI to make native calls into the COM and Win32 libraries.

它是一个 Java 库,它使用 JNI 对 COM 和 Win32 库进行本机调用。

More info (and examples) hereand here.

更多信息(和示例)在这里这里

回答by autoboto

Try JWinAuto. JWinAuto is a simple wrapper around AutoIt to allow java applications to automate Win32 GUIs.

试试 JWinAuto。JWinAuto 是 AutoIt 的一个简单包装器,它允许 Java 应用程序自动化 Win32 GUI。

http://jwinauto.sourceforge.net/

http://jwinauto.sourceforge.net/

回答by Jim Rush

There's also a commercial product from http://www.nevaobject.com/the provides this functionality. I've used older versions without any problems...other than having to understand the challenges around COM.

还有一个来自http://www.nevaobject.com/的商业产品提供了这个功能。我使用旧版本没有任何问题......除了必须了解围绕 COM 的挑战。