← Back to team overview

sikuli-driver team mailing list archive

Re: [Question #246694]: Sikuli with Selenium Java

 

Question #246694 on Sikuli changed:
https://answers.launchpad.net/sikuli/+question/246694

RaiMan proposed the following answer:
ok, in Java:

Screen s = new Screen();
Pattern imgRechner = new Pattern("titleOn.png").exact().targetOffset(-38,38); // window title activated
if null = s.exists(imgRechner, 0) {
    s.click(Pattern("titleOff.png").exact()); // window title not activated
}
s.find(imgRechner);
Region regResult = Region.create(s.getLastMatch().getTarget(), 235, 20); // get the result field
s.click(new Pattern("btnClearAll.png").exact());
regResult.highlight(2);
s.click(new Pattern("btn4.png").exact());
s.click(new Pattern("btnMult.png").exact());
s.click(new Pattern("btn5.png").exact());
s.click(new Pattern("btn0.png").exact());
s.click(new Pattern("btnResult.png").exact());
Settings.OcrTextRead = true;
s.wait(1);
String txtResult = result.text();
if  txtResult.contains("200")
    System.out.println "Pass: " + txtResult;
else
    System.out.println "Fail";

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