use of org.sikuli.script.FindFailed in project sakuli by ConSol.
the class RegionImpl method waitForImage.
/**
* {@link Region#waitForImage(String, int)} ()}
*/
public RegionImpl waitForImage(String imageName, int seconds) {
Match match;
ImageLibObject imageObj = loadImage(imageName);
try {
match = this.wait(imageObj.getPattern(), seconds);
} catch (FindFailed findFailed) {
match = null;
}
if (match != null) {
return toRegion(match);
}
loader.getExceptionHandler().handleException("Can't find \"" + imageObj + "\" in" + this + "waitFor function in " + seconds + " sec.", this, resumeOnException);
return null;
}
Aggregations