Skip to main content

SIKULI INSTALLATION AND INTEGRATION WITH WEBDRIVER

Sikuli: Sikuli automates anything you see on the screen. It uses image recognition to identify and control GUI components. It is useful when there is no easy access to a GUI’s internal or source code.
For Installation of Sikuli and its Integration with Selenium Webdriver follow the steps given below:
Sikuli Installation
Step : 1  Download sikuli-setup.jar
Step 2: Go to this path and downlaod https://launchpad.net/sikuli/+download
Step 3 : sikuli-setup.jar
Step 4: Now open the command Window go to folder where this jar file is present
C:/<path to the jar file> and then type runSetup.cmd  (note no spaces between runSetUp.cmd)incommandprompt
Step 5 : the a pop-up will open saying “Please read carefully before proceeding” click “OK”
Step 6: Sikuli Setup window will open select first 3 checkboxes and click on “Setup Now” then click “Yes”
Step 7 : Wait for completely Sikuli-ide-1.0.1.jar(12MB file) file to download (will take some time(around 5-10 minutes))
Step 8: Then Sikuli IDE will start automatically (DONE)
Integration with Selenium Webdriver
1.Add the following jar files to the project in which you want to integrate Sikuli tool.
i.Sikuli-api-1.0.2-standalone.jar
ii.Sikuli-webdriver-1.0.2-standalone.jar
iii.Selenium-server-standalone-2.33.0.jar
iv.selenium-java-2.25.0.jar
2.Take the image of the object on which you want to perform operations like click,type,etc.
Here is an e.g to click on a flash button.
Screen screen = new Screen();
Pattern image = new Pattern("path to flash button image");
screen.click(image);
3.After placing this code you will see some errors as libraries are not imported. Just mouse over where errors are showing and include those libraries which eclipse is suggesting.Those libraries are below:
import org.sikuli.script.Pattern;
import org.sikuli.script.Screen;
import org.sikuli.script.FindFailed; 
4.Now run the code and you are good to go!

Comments

Popular posts from this blog

Eclipse New Maven Project: Could not resolve archetype

Close Eclipse Delete repository folder (you can find it in C:\Users{your user}.m2) Open Eclipse again. It will install maven repository automatically down v Open Window > Preferences Open Maven > Archetypes Click 'Add Remote Catalog' and add the following: Catalog File:  http://repo1.maven.org/maven2/archetype-catalog.xml Description: maven catalog

How to setup Appium for mobile automation

GitHub is a code hosting platform for version control and collaboration.  When a project is to be created, constant changes are made to the code. Version control systems keep these revisions straight, and store the modifications in a central repository.   A repository is a location where all the files for a particular project are stored. Each project will have its own repository, and can be accessed by a unique URL. Step 1: Install Appium-desktop-setup-1.2.6 (from the link Appium.io) Step 2: Install JDK Step 3: Install android studio-bundle (from developerandroid.com) Step 4: Go to AppData->Local->Android->Sdk Step 5: Copy the above path and set the path of a new environment variable “ANDROID_HOME” Step 6: Copy the above path, append \tools and add it in the path variable Steps 7: Copy the path from Step 5, append \platform-tools and add it in the path variable Step 8: Go to AppData->Local->Android->Sdk->tools->bin->uiautomatorview...

Setup Grid and run your test script on different Machine

1. selenium-server-standalone-3.11.0.jar should download on our local machine. we can download this from here  https://www.seleniumhq.org/download/ 2. After that open the command prompt and go in to the drive where we have downloaded "selenium-server-standalone-3.11.0.jar" file and run the command "java -jar selenium-server-standalone-3.11.0.jar -role hub " 3. Once this will execute successfully we can see on console "Selenium Grid hub is up and running" 4. Now we can see GRID console on browser by opening this url:  http://localhost:4444/grid/console 5. Now GRID is setup successfully 5. Now we have to register Node machine with GRID. For this we will open the node machine and download "selenium-server-standalone-3.11.0.jar", chrome driver, Firefox driver form here  https://www.seleniumhq.org/download/ 6. After that we have to register node machine with GRID by running this command using command prompt : For Chrome Browser run this command ...