Sikuli GUI Automation Tool Tutorial
Sikuli is a tool to automate graphical user interfaces (GUI) using “Visual Image Match” method. In Sikuli, all the web elements should be taken as an image and stored inside the project. Sikuli will trigger GUI interactions based on the image visual match, the image which we have passed as the parameter along with all methods.
Sikuli can be very much useful to automate flash objects (which do not have ID or name). It can be useful in the situation, where we have a stable GUI (i.e. GUI components not changing).
Even Window based applications can also be automated using Sikuli. Sikuli provides very friendly Sikuli-script.jar, which can be easily used together with Selenium WebDriver. We can even automate Adobe Video/Audio player, Flash Games on website using Sikuli. With simple API, it makes coding easier.
Steps to Create Sikuli Java Project:
Step #1: Sikuli Download - Download Sikuli from here.
Step #2: Extract the zip file which you’ve downloaded. It will contain sikuli-script.jar file. Save this extracted file in your local file system.
Step #3: Open Eclipse.
Step #4: Create a java project File -> New -> Java Project
Right Click on the project
Go to Build path -> Configure Build Path
Switch to Libraries tab
Click “Add External Jars” button and Add Sikuli-Script.jar in the Build path.
Some Sikuli Methods:
#1: Creating Object for Screen Class
Screen is a base class provided by Sikuli. We need to create object for this screen class first, then only we can access all the methods provided by Sikuli.
Screen s=new Screen();
#2: Click On An Element
This method used to Click on the specific image present on the screen.
#3: Right Click On An Element
This method used to right click on the specific image present on the screen.
#4: find An Element
This method used to find a specific element present on the screen.
#5: Double Click on An Element
This method used to trigger double click event on a specific image present on the screen.
#6: Check whether an Element present on the Screen
This Method is used to check whether the specified element is present on the screen.
#7: Type a string on a Textbox
This Method is used to enter the specified text on the Text box.
s.type(“<<image name>>”,”String to be typed”);
#8: Wheeling on a particular image
This method is used to perform wheeling action on the element image.
s.wheel(“<<image name>>”,<<int position>>,<<int direction>>);
#9: Drag and Drop a Image/Element
This method is used to drag and drop a specified image from source position to target position.
s.dragDrop(“<<source image name>>”,”<<target image name>>”);
... to read more articles, visit http://sqa.fyicenter.com/art/