

- Trending Categories
Data Structure
Networking
RDBMS
Operating System
Java
iOS
HTML
CSS
Android
Python
C Programming
C++
C#
MongoDB
MySQL
Javascript
PHP
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
How to integrate Sikuli scripts into Selenium?
We can integrate Sikuli scripts into Selenium webdriver. Sikuli is an automation tool which is open-source. It has the feature to capture the images on the elements as well as perform operations on them.
Some of the advantages of Sikuli are −
Desktop or Windows applications can be automated.
Can be used for flash testing.
Can be used on platforms like mobile, Mac, and Linux.
It is based on image recognition technique.
Can be easily integrated with Selenium.
To integrate Sikuli with Selenium, follow the below steps − Navigate to the link − https://launchpad.net/sikuli/+download.
Click on the jar to download it (which can be used for Java environments) and save it in a location.
Add the jar to the Java project in Eclipse IDE. Right−click on the project and select Properties. Then click on Java Build Path. Go to the Java Build Path tab. Click on Libraries. Then click on Add External JARs. Browse and add the Sikuli jar that we downloaded. Finally, click on Apply and Close.
Capture the image of the edit box on which we will enter Selenium with the help of Sikuli and save it in a location.
Example
import org.openqa.selenium.WebDriver; import org.openqa.selenium.WebElement; import org.openqa.selenium.chrome.ChromeDriver; import org.sikuli.script.FindFailed; import org.sikuli.script.Pattern; import org.sikuli.script.Screen; public class SikuliIntegrate{ public static void main(String[] args) { System.setProperty("webdriver.chrome.driver", "C:\\Users\\ghs6kor\\Desktop\\Java\\chromedriver.exe"); WebDriver driver = new ChromeDriver(); driver.manage().timeouts().implicitlyWait(5, TimeUnit.SECONDS); driver.get("https://www.tutorialspoint.com/index.htm"); // Screen class to access Sikuli methods Screen s = new Screen(); //object of Pattern to specify image path Pattern e = new Pattern("C:\\Users\\ghs6kor\\Image.png"); //add wait time s.wait(e, 5); //enter text and click s.type(e, "Selenium"); s.click(e); } }
Output
- Related Questions & Answers
- How To Use TestNG Framework For Creating Selenium Scripts?
- How to integrate Google AdSense into your webpage?
- How do I keep a session alive for long Selenium scripts in automation?
- How to integrate Android Snackbar?
- HTML DOM scripts Collection
- How to reduce the number of errors in scripts?
- How to integrate Facebook using Kotlin?
- How to integrate Android Speech To Text?
- What are Scripts In Postman?
- Scroll Element into View with Selenium.
- How to integrate facebook in Android App?
- Understanding the npm scripts in node.js
- How to set line breaking rules for non-CJK scripts in JavaScript?
- What is Pre Requests scripts in Postman?
- How to properly integrate HTML5 Boilerplate with Twitter Bootstrap?