0

Doing the desktop automation with help of sikuli but when trying to call the image that time give the "NullPointerException" exception.

Code :

public static Screen s;
  public static void main(String arg[]) throws IOException, InterruptedException, Exception {
        Runtime.getRuntime().exec("images/Nintei_launch.exe");
        Thread.sleep(5000);
        s.click("c:/Users/abc/Desktop/Winword/selectSession.PNG");

thank in advance

Patrick
  • 12,336
  • 15
  • 73
  • 115

1 Answers1

0

you have an static object Screen s, this is declared but no initialized, so when you call s.click() you get a nullPointerException...

Take a look at this post: What is a Null Pointer Exception, and how do I fix it?

Community
  • 1
  • 1
ΦXocę 웃 Пepeúpa ツ
  • 47,427
  • 17
  • 69
  • 97