← Back to team overview

sikuli-driver team mailing list archive

[Question #278838]: SIKULI return NuLL

 

New question #278838 on Sikuli:
https://answers.launchpad.net/sikuli/+question/278838

This code working:
Import org.sikuli.script.App;
import java.awt.Window;
import org.junit.Test;
import org.sikuli.script.FindFailed;
import org.sikuli.script.Pattern;
import org.sikuli.script.*;
import org.sikuli.script.Screen;

public class Testpiem_1 {
@Test
	public void  Meginajums() throws FindFailed {

		Screen screen=new Screen(); 

		Pattern dialogwindow = new Pattern("First_screen.png");
			Pattern clickvestules = new Pattern("Vestules.png");
				Region window = screen.wait(dialogwindow);
					window.click("Vestules.png");
}
} 

But this code return java.lang.NullPointerException:

import org.sikuli.script.App;
import java.awt.Window;

import org.junit.Test;
import org.sikuli.script.FindFailed;
import org.sikuli.script.Pattern;
import org.sikuli.script.*;
import org.sikuli.script.Screen;

public class Testpiem_1 {
	
	private Screen s;
	private static Pattern dialogwindow;
	private static Pattern clickvestules;
        private Region window;
	
	public void Testing()
	{
		s = new Screen();
		dialogwindow = new Pattern ("First_screen.png");
		clickvestules = new Pattern ("Vestules.PNG");
	
	}

@Test
	public void  Meginajums() throws FindFailed {
	
	Region window = s.wait(dialogwindow,10);
	window.click(clickvestules);
}
}

Help me, please!

-- 
You received this question notification because your team Sikuli Drivers
is an answer contact for Sikuli.