Skip to content

Instantly share code, notes, and snippets.

@Vanilton18
Created February 24, 2016 02:43
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Vanilton18/084418ee779e7bd58c14 to your computer and use it in GitHub Desktop.
Save Vanilton18/084418ee779e7bd58c14 to your computer and use it in GitHub Desktop.
package net.vanilton.test;
import java.io.IOException;
import javax.swing.JOptionPane;
import org.sikuli.script.FindFailed;
import org.sikuli.script.Screen;
public class HelloWorldSikuliXIDE {
static Screen screen = new Screen();
public static void main(String[] args) throws FindFailed, IOException {
// Comente o Runtime para o app não ser aberto
Runtime.getRuntime().exec("java -jar examples-sikuli.jar");
if (screen.exists("src//test//resources//pictures//main.png") != null) {
JOptionPane.showMessageDialog(null, "Uhuu! Encontrei o app aberto!", null, 1);
} else {
JOptionPane.showMessageDialog(null, "Oops! Não encontrei o app aberto", null, 1);
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment