如何在Sikuli中编写java程序?

我使用SIKULI录制了GUI桌面应用程序,如下所示:

App.open ("C:\\Program Files\\acd\\bin\\VPNClient.exe") sleep(1) type ("mganda1") sleep(1) click( ) //click OK 

我想将此脚本转换为Java。 所以我想尝试如下:

 package com.arcot.test.vpn; import org.sikuli.script.*; public class AuthLogin { public static void main(String[] args) { Screen s = new Screen(); App myApp = new App("application-identifier") ; myApp.open ("C:\\Program Files\\acd\\bin\\VPNClient.exe"); 

//如何在这里模拟类型,睡眠和点击function?

我正在搜索java示例以了解对象关系以及如何使用它来模拟记录的脚本。 如果您有任何人知道帮助我的链接,请提供。

最好的问候,Madhu

完成程序后,按以下方式继续:

 package com.arcot.test.vpn; import org.sikuli.script.*; public class AuthLogin { public static void main(String[] args) { Screen s = new Screen(); App myApp = new App("application-identifier") ; myApp.open ("C:\\Program Files\\acd\\bin\\VPNClient.exe"); 

请以这种方式进行,在包中创建一个图像文件夹“img” – 复制img文件夹中的所有相应图像 – 将文件夹中的图像名称分配给不同的变量

要执行操作,请使用以下命令:

 s.type("mganda1"); s.sleep(time); s.click("ok.png"); 

此致,Npesik

马杜,

我不知道为什么你用sikuli记录脚本来吃午餐。 yu使用的所有命令都不会调用任何图像,并且都可以在没有sikuli ide的情况下编写。

我会对你的原始sikuli / jython脚本进行以下更改

 App.open ("C:\\Program Files\\acd\\bin\\VPNClient.exe") sleep(1) //change to wait(path to image, FOREVER) //By changing to a wait there is an implicit find as defined by the path to the image type ("mganda1") //if there are issues verifying focus invoke type with the img option sleep(1) //use wait instead of sleep click( ) //click OK //What are you clicking on? 

关于Java,这里是Sikuli javadocs的链接