Sikuli beta image based automation sample


#1

Starting from WorkFusion 8.2 we are using sikuli based automation, but it is beta solution right now
Sample bellow shows code with Sikuli:

     String json = desktopDriver.executeScript("" +
                    "import org.sikuli.script.*;\n" +
                    "import java.util.concurrent.Callable;\n" +
                    "import com.workfusion.common.utils.SynchUtils;\n" +
                    "\n" +
                    "return SynchUtils.withFocusLock(new Callable<String>() {\n" +
                    "    @Override\n" +
                    "    public String call() throws Exception {\n" +
                    "        try {\n" +
                    "            ImagePath.add(\"" + imagePath + "\");\n" +
                    "            Screen screen = new Screen();\n" +
                    "            if (screen.exists(\"" + imageName + "\") == null) {\n" +
                    "                throw new NoSuchElementException(\"Image does not found : "+imageName+"\"); " +
                    "            }\n" +
                    "            Match match = screen.find(\"" + imageName + "\");\n" +
                    "            return groovy.json.JsonOutput.toJson([" +
                    "                x: match.getRect().getX()," +
                    "                y: match.getRect().getY()," +
                    "                width: match.getRect().getWidth(), " +
                    "                height: match.getRect().getHeight()]);\n" +
                    "        } finally {\n" +
                    "            ImagePath.remove(\"" + imagePath + "\");\n" +
                    "        }\n" +
                    "    }\n" +
                    "}, false);", "GROOVY");

Sending keys using Sikuli

    desktopDriver.manage().set("typeOnScreen", Boolean.TRUE.toString());
    desktopDriver.getKeyboard().sendKeys("");

#2

Does WF Studio 8.2 available for downloading?


#3

There is misspelling in topic name: http://www.sikuli.org/ .

When WF Studio 8.2 will be available and what improvements will be released ?


#4

WF Studio 8.4 is planned to be released in June.


#5

There are somewhere available Release notes?