amitbanerjee28 / sikuli-api

Automatically exported from code.google.com/p/sikuli-api
0 stars 0 forks source link

Getting null pointer exception if i use multiple ScreenRegion in one test method #77

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
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());

  }

Original issue reported on code.google.com by deepu.g...@gmail.com on 7 Oct 2013 at 3:20