sikuli automation tool

SIKULI AUTOMATION TOOL

Table of Contents

Sikuli is an open source automation tool which is GUI based. Its purpose is to interact with elements of webpages and handling windows based popups. The main technique sikuli uses is of “Image Recognition” and “Control GUI”. Here the web elements are taken as images and stored inside the project. It is built with java allowing sikuli to run on windows,mac, Linux.

How to setup sikuli automation tool:

  1. Visit the website http://www.sikulix.com/
SIKULI AUTOMATION TOOL
  1. Download the sikulixsetup.jar
SIKULI AUTOMATION TOOL
  1. Keep it in an empty folder where you want keep all your sikulix files.
  2. Java should be installed for this tool to run.
  3. Run the jar, (install the pack 1)
  4. Sikuli will then proceed to setup.

The Interface

Sikuli comes with its own IDE (integrated development environment). Sikuli’s IDE is extremely powerful on its own. Without any programming knowledge we can make sikuli automate many tasks. It has many patterns like PSMRL.

P-Pattern: A pattern object

S-string: path to an image or just txt

M-match: A match from a previous find

R-region: A region object

L-Location: A location object, screen point.

We work with patterns as we can specify an image and a location to click. Patterns are the primary object we use in the series and patterns contain an image and information about that image ie. size, similarity and target offset.

Simple task to create a script

Create a script that opens the calculator app and ads 1+1 together.

Lets open sikuli IDE:

SIKULI AUTOMATION TOOL

This IDE is opened by clicking the file sikullix.cmd 

In the left side of the IDE we have different options like Find, Mouse actions and Keyboard actions.

Select the events from the given options one by one then it will allow selecting the image of the required command. Add one by one image according to the task. Using the left options select the click option. It will allow us to select the image. Then select the start button drag it to the IDE.

SIKULI AUTOMATION TOOL


SIKULI AUTOMATION TOOL

Then in the next line drag the calculator button as image by opening the application calculator. Drag the required keys for the operation one by one. Save and run the application. 

SIKULI AUTOMATION TOOL

We can also view the code in html code the sikuli creates the code of selected image in the html form.

SIKULI AUTOMATION TOOL

When we open the file the actual script is created.

SIKULI AUTOMATION TOOL

SIKULI AUTOMATION TOOL

Practical uses of Sikuli

  1. Sikuli is used to automate flash objects/flash  websites.
  2. It is useful to automate the windows based applications. What we see in the screen.
  3. It provides simple API; all methods are accessed using the screen class objects.
  4. Sikuli provides extensive support to automate flash objects.
  5. Using Sikuli we can automate desktop applications.

Benefits

  1. It is an open source tool.
  2. One of the biggest advantages of sikuli is that it can easily automate flash objects.
  3. The windows applications automated easily.

Some sikuli methods are:

  1. Creating object for screen class: The screen is the base class provided by sikulli.We need to create the object for this class and access all the methods.

Syntax:
Screen s=new Screen();

  1. Click on an element: This is used to click a particular image present on the screen.

Syntax:
s.click(“<<image name>>”);

  1. Find an element: This is used to find the particular element present on the screen.

Syntax:
s.find(“<<image name>>”);

  1. Type a string on a TextBox:This method is used to enter the text on 

The text box.Syntax:
s.type(“<<image name>>”,”String to be typed”);

Share this article
Subscribe
By pressing the Subscribe button, you confirm that you have read our Privacy Policy.
Need a Free Demo Class?
Join H2K Infosys IT Online Training