sikuli-driver team mailing list archive
-
sikuli-driver team
-
Mailing list archive
-
Message #44914
Re: [Question #661532]: region with finder
Question #661532 on Sikuli changed:
https://answers.launchpad.net/sikuli/+question/661532
Status: Open => Answered
RaiMan proposed the following answer:
String imagePath = "/Users/aathi/Desktop/" // the place where you have your images (should be a folder to not clutter the desktop)
WebElement elmt = driver2.findElement(By.xpath("//*[@id='window']"));
Screenshot regionset = new AShot().takeScreenshot(driver, elmt);
//Finder has a constructor with a buffered image
Finder window = new Finder(regionset.getImage()); // where to search in
Pattern testImage = new Pattern(new File(imagePath, testimage2.png)).getAbsolutePath)); // what to search
window.find(testImage) // search and prepare Finder for revealing result
Match found = null;
if (window.hasNext()) {
//found
found = window.next()
} else {
// not found
}
System.out.println(found)
With a mature IDE like Eclipse or IntelliJ IDEA you might inspect the
SikuliX API and together with the docs just learn and find your way.
One more thing: you should get familiar with the SikuliX concept of
ImagePath.
--
You received this question notification because your team Sikuli Drivers
is an answer contact for Sikuli.