1

I have recorded the GUI desktop application using SIKULI as below:

App.open ("C:\\Program Files\\acd\\bin\\VPNClient.exe")
sleep(1)

type ("mganda1")
sleep(1)
click( ) //click OK

I want to convert this script into Java. So I am trying as below:

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");

//How to simulate the type, sleep and click functions here?

I am searching for java examples to understand the objects relation and how to use it to simulate the recorded scripts. Please provide if any of you know the links that help me.

Best regards, Madhu

4

2 回答 2

2

在您的程序之后,请按以下方式进行:

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

于 2013-02-14T10:58:40.207 回答
1

马杜,

我不确定你为什么录制脚本来与 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 的链接

于 2011-04-04T06:40:38.460 回答