How to write java program in Sikuli?

ⅰ亾dé卋堺 提交于 2019-12-06 15:29:45

After your program, proceed in following way:

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

Kindly proceed in this way, -Create one image folder inside your package "img" -Copy all the respective images in the img folder -Assign the image names in a folder to a different variables

For doing operations, use follwing command:

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

Regards, Npesik

Surfdork

Madhu,

I'm not sure why you recorded the script to lunch that app with sikuli. All of the commands yu use don't invoke any images and can all be written without the sikuli ide.

I would make the following changes to your original sikuli/jython script

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?

Regarding Java, here's the link to Sikuli javadocs

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!