← Back to team overview

sikuli-driver team mailing list archive

[Question #236965]: Getting null pointer exception if i use muliple ScreenRegion in one test method

 

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

Hi,

I am writing a sample test method for 7-zip software to zip a folder. When i exexute the method i am getting "NullPointerException". How to use 2 ScreenRegions in one test method. Please help me.

Below is the test method : 

@Test
  public void f() throws FindFailed {
	
	ScreenRegion s = new DesktopScreenRegion();
	  Target target = new ImageTarget(new File("C:\\Users\\gnanadeep.bitra\\Desktop.sikuli\\7zip.png"));
	  ScreenRegion r = s.find(target);
	  Mouse mouse = new DesktopMouse();
	  mouse.click(r.getCenter());
	    

	  Target target1 = new ImageTarget(new File("C:\\Users\\gnanadeep.bitra\\Desktop.sikuli\\sensoricon.png"));
	  ScreenRegion sensorregion = s.find(target1);
	  mouse.click(sensorregion.getCenter());
	 
  }

-- 
You received this question notification because you are a member of
Sikuli Drivers, which is an answer contact for Sikuli.