SlideShare a Scribd company logo
1 of 7
Download to read offline
Sikuli
Mohd Shahabuddin Page 1
What is Sikuli?
 Automation scripting tool
 Supports Python, Ruby and Java language
 Runs on Mac, Linux/Unix and Windows
Why Sikuli?
 Automates anything you see on the screen of your desktop computer running
Windows, Mac or Linux/Unix.
 It uses image recognition to identify and control GUI components.
 Sikuli is the only option when there is no way to identify web elements
 It can run the mouse and the keyboard to interact with the identified GUI
elements.
History:
 Open-source research project.
 Started at MIT
 Started by Tsung-Hsiang Chang and Tom Yeh
What are the prerequisite to learn Sikuli?
 Any scripting language with selenium web driver
How to install Sikuli in maven project?
Step-1:
 Add the following dependency in pom.xml file
<dependency>
<groupId>org.sikuli</groupId>
<artifactId>sikuli-java</artifactId>
<version>1.0.1</version>
Sikuli
Mohd Shahabuddin Page 2
</dependency>
 If not downloaded automatically during maven clean install then manually
download 'sikuli-java.jar' and save it on specific location say ‘c:sikulisikuli-
java.jar’
i) Open command prompt.
ii) Run the below command.
mvn install:install-file -Dfile= c:sikulisikuli-java.jar -DgroupId=org.sikuli -
DartifactId=sikuli-java -Dversion=1.0.1 -Dpackaging=jar -DgeneratePom=true
iii) If you don’t see 'build successful' then re-trace your steps.
Step-2
 Go to the local repository of the user and verify the following files present:
How to type a text in a text field when using element locator?
Step-1
Sikuli
Mohd Shahabuddin Page 3
 Go to the google screen shown below:
Step-2
 Create a test to type text ‘Hello World’ in google search text field.
@Test()
public void sikuliTest() throws Exception {
Screen s = new Screen();
s.type("Hello World");
}
 Run as TestNG test
Sikuli
Mohd Shahabuddin Page 4
Step-3
 See text is typed in browser’s URL instead of google search text field because
Skilui captures entire screen and find a first text field anywhere on the screen and
perform the action on it.
How To distinguish one image from other and perform action on it?
Step-1
 Let us create a test to type a text ‘Hello World’ in Google’s search text field
 Copy the portion of Google’s screen where we have search text field as shown
below in a .png file using MS Paint. Let file is saved in location
c:google‘GoogleTextField.png’
 Saved file loacation
Sikuli
Mohd Shahabuddin Page 5
v
Step-2
 Write a test to first verify the desired text field presence and then type a text into
it.
@Test()
public void sikuliTest() throws Exception {
String googleSearchTextFieldFilePath="C:/google/GoogleTextField.png";
Thread.sleep(2000);
Region r = new Screen();
//saved pattern on drive
Pattern savedPattern = new Pattern(googleSearchTextFieldFilePath);
//set the percentage of matching intensity. 0.8 is the maximum match value
savedPattern = savedPattern.similar(0.8f);
//check whether saved pattern is present on the current screen with expected
matching intensity( i.e 8).
//If match not found Null is returned
Match match = r.exists(savedPattern, 8);
logger.info("Pattern " + googleSearchTextFieldFilePath + "->" + match);
Assert.assertNotNull(match, "pattern "+googleSearchTextFieldFilePath+" not
found");
//to set the focus to google search text field
r.keyDown(KeyEvent.VK_ENTER);
//wait a bit
Thread.sleep(2000);
//type the desired text into matching pattern
r.type("Hello World");
}
 Right click and run as TextNG. Below is the output where test is typing text into
desired location
Sikuli
Mohd Shahabuddin Page 6
Further practices
 There are many APIs that can be used as per the requirement. Below screen
shows few of them:
Sikuli
Mohd Shahabuddin Page 7
***

More Related Content

What's hot

THe Pragmatic Programmer - Basic tools
THe Pragmatic Programmer - Basic toolsTHe Pragmatic Programmer - Basic tools
THe Pragmatic Programmer - Basic toolsRuiyun Zhou
 
Develop Games With Cocos Creator - A Game Engine By Cocos
Develop Games With Cocos Creator - A Game Engine By CocosDevelop Games With Cocos Creator - A Game Engine By Cocos
Develop Games With Cocos Creator - A Game Engine By CocosLuke Stapley
 
Google Developer Student Club Avantika University Info Session
Google Developer Student Club Avantika University Info SessionGoogle Developer Student Club Avantika University Info Session
Google Developer Student Club Avantika University Info SessionAKSHATPATEL48
 
G so c_2015_presentation
G so c_2015_presentationG so c_2015_presentation
G so c_2015_presentationSuyash Tilhari
 
Testing & Deploying node.js apps
Testing & Deploying node.js appsTesting & Deploying node.js apps
Testing & Deploying node.js appsSteven Beeckman
 

What's hot (9)

Building at a glance
Building at a glanceBuilding at a glance
Building at a glance
 
Homework
HomeworkHomework
Homework
 
THe Pragmatic Programmer - Basic tools
THe Pragmatic Programmer - Basic toolsTHe Pragmatic Programmer - Basic tools
THe Pragmatic Programmer - Basic tools
 
Spring_2016_Resume
Spring_2016_ResumeSpring_2016_Resume
Spring_2016_Resume
 
Q6
Q6Q6
Q6
 
Develop Games With Cocos Creator - A Game Engine By Cocos
Develop Games With Cocos Creator - A Game Engine By CocosDevelop Games With Cocos Creator - A Game Engine By Cocos
Develop Games With Cocos Creator - A Game Engine By Cocos
 
Google Developer Student Club Avantika University Info Session
Google Developer Student Club Avantika University Info SessionGoogle Developer Student Club Avantika University Info Session
Google Developer Student Club Avantika University Info Session
 
G so c_2015_presentation
G so c_2015_presentationG so c_2015_presentation
G so c_2015_presentation
 
Testing & Deploying node.js apps
Testing & Deploying node.js appsTesting & Deploying node.js apps
Testing & Deploying node.js apps
 

Similar to Automation testing using Sikuli

Uploading files using selenium web driver
Uploading files using selenium web driverUploading files using selenium web driver
Uploading files using selenium web driverPankaj Biswas
 
Google Drive & Google Drive SDK
Google Drive & Google Drive SDKGoogle Drive & Google Drive SDK
Google Drive & Google Drive SDKGDG Algiers
 
Android UI Testing with Appium
Android UI Testing with AppiumAndroid UI Testing with Appium
Android UI Testing with AppiumLuke Maung
 
Easy path to machine learning (2022)
Easy path to machine learning (2022)Easy path to machine learning (2022)
Easy path to machine learning (2022)wesley chun
 
Prasadraj SIKULI Presentation 1
Prasadraj SIKULI Presentation 1Prasadraj SIKULI Presentation 1
Prasadraj SIKULI Presentation 1Prasadraj Mankar
 
Google's serverless journey: past to present
Google's serverless journey: past to presentGoogle's serverless journey: past to present
Google's serverless journey: past to presentwesley chun
 
Getting started with appium
Getting started with appiumGetting started with appium
Getting started with appiumPratik Patel
 
Lecture 12 - Maps, AR_VR_aaaaHardware.pptx
Lecture 12 - Maps, AR_VR_aaaaHardware.pptxLecture 12 - Maps, AR_VR_aaaaHardware.pptx
Lecture 12 - Maps, AR_VR_aaaaHardware.pptxNgLQun
 
Play Framework on Google App Engine
Play Framework on Google App EnginePlay Framework on Google App Engine
Play Framework on Google App EngineFred Lin
 
Flutter vs Java Graphical User Interface Frameworks - text
Flutter vs Java Graphical User Interface Frameworks - textFlutter vs Java Graphical User Interface Frameworks - text
Flutter vs Java Graphical User Interface Frameworks - textToma Velev
 
Features everywhere
Features everywhere Features everywhere
Features everywhere Mediacurrent
 
How to feature flag and run experiments in iOS and Android
How to feature flag and run experiments in iOS and AndroidHow to feature flag and run experiments in iOS and Android
How to feature flag and run experiments in iOS and AndroidOptimizely
 
[Ultracode Munich #4] Short introduction to the new Android build system incl...
[Ultracode Munich #4] Short introduction to the new Android build system incl...[Ultracode Munich #4] Short introduction to the new Android build system incl...
[Ultracode Munich #4] Short introduction to the new Android build system incl...BeMyApp
 
Jose l ugia 6 wunderkinder, momenta
Jose l ugia  6 wunderkinder, momentaJose l ugia  6 wunderkinder, momenta
Jose l ugia 6 wunderkinder, momentaapps4allru
 
How to build and publish a google home app with dialogflow
How to build and publish a google home app with dialogflowHow to build and publish a google home app with dialogflow
How to build and publish a google home app with dialogflowMoses Sam Paul Johnraj
 
Starting with jQuery
Starting with jQueryStarting with jQuery
Starting with jQueryAnil Kumar
 

Similar to Automation testing using Sikuli (20)

Uploading files using selenium web driver
Uploading files using selenium web driverUploading files using selenium web driver
Uploading files using selenium web driver
 
sikuli final
sikuli finalsikuli final
sikuli final
 
Sikuli script
Sikuli scriptSikuli script
Sikuli script
 
Google Drive & Google Drive SDK
Google Drive & Google Drive SDKGoogle Drive & Google Drive SDK
Google Drive & Google Drive SDK
 
Selenium using C# by Yogesh Kumar
Selenium using C# by  Yogesh KumarSelenium using C# by  Yogesh Kumar
Selenium using C# by Yogesh Kumar
 
Android UI Testing with Appium
Android UI Testing with AppiumAndroid UI Testing with Appium
Android UI Testing with Appium
 
Easy path to machine learning (2022)
Easy path to machine learning (2022)Easy path to machine learning (2022)
Easy path to machine learning (2022)
 
Prasadraj SIKULI Presentation 1
Prasadraj SIKULI Presentation 1Prasadraj SIKULI Presentation 1
Prasadraj SIKULI Presentation 1
 
Google's serverless journey: past to present
Google's serverless journey: past to presentGoogle's serverless journey: past to present
Google's serverless journey: past to present
 
Getting started with appium
Getting started with appiumGetting started with appium
Getting started with appium
 
Lecture 12 - Maps, AR_VR_aaaaHardware.pptx
Lecture 12 - Maps, AR_VR_aaaaHardware.pptxLecture 12 - Maps, AR_VR_aaaaHardware.pptx
Lecture 12 - Maps, AR_VR_aaaaHardware.pptx
 
Play Framework on Google App Engine
Play Framework on Google App EnginePlay Framework on Google App Engine
Play Framework on Google App Engine
 
Flutter vs Java Graphical User Interface Frameworks - text
Flutter vs Java Graphical User Interface Frameworks - textFlutter vs Java Graphical User Interface Frameworks - text
Flutter vs Java Graphical User Interface Frameworks - text
 
google drive
google drivegoogle drive
google drive
 
Features everywhere
Features everywhere Features everywhere
Features everywhere
 
How to feature flag and run experiments in iOS and Android
How to feature flag and run experiments in iOS and AndroidHow to feature flag and run experiments in iOS and Android
How to feature flag and run experiments in iOS and Android
 
[Ultracode Munich #4] Short introduction to the new Android build system incl...
[Ultracode Munich #4] Short introduction to the new Android build system incl...[Ultracode Munich #4] Short introduction to the new Android build system incl...
[Ultracode Munich #4] Short introduction to the new Android build system incl...
 
Jose l ugia 6 wunderkinder, momenta
Jose l ugia  6 wunderkinder, momentaJose l ugia  6 wunderkinder, momenta
Jose l ugia 6 wunderkinder, momenta
 
How to build and publish a google home app with dialogflow
How to build and publish a google home app with dialogflowHow to build and publish a google home app with dialogflow
How to build and publish a google home app with dialogflow
 
Starting with jQuery
Starting with jQueryStarting with jQuery
Starting with jQuery
 

Recently uploaded

Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...MyIntelliSource, Inc.
 
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...MyIntelliSource, Inc.
 
Implementing Zero Trust strategy with Azure
Implementing Zero Trust strategy with AzureImplementing Zero Trust strategy with Azure
Implementing Zero Trust strategy with AzureDinusha Kumarasiri
 
XpertSolvers: Your Partner in Building Innovative Software Solutions
XpertSolvers: Your Partner in Building Innovative Software SolutionsXpertSolvers: Your Partner in Building Innovative Software Solutions
XpertSolvers: Your Partner in Building Innovative Software SolutionsMehedi Hasan Shohan
 
Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...
Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...
Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...stazi3110
 
What are the features of Vehicle Tracking System?
What are the features of Vehicle Tracking System?What are the features of Vehicle Tracking System?
What are the features of Vehicle Tracking System?Watsoo Telematics
 
KnowAPIs-UnknownPerf-jaxMainz-2024 (1).pptx
KnowAPIs-UnknownPerf-jaxMainz-2024 (1).pptxKnowAPIs-UnknownPerf-jaxMainz-2024 (1).pptx
KnowAPIs-UnknownPerf-jaxMainz-2024 (1).pptxTier1 app
 
Intelligent Home Wi-Fi Solutions | ThinkPalm
Intelligent Home Wi-Fi Solutions | ThinkPalmIntelligent Home Wi-Fi Solutions | ThinkPalm
Intelligent Home Wi-Fi Solutions | ThinkPalmSujith Sukumaran
 
Asset Management Software - Infographic
Asset Management Software - InfographicAsset Management Software - Infographic
Asset Management Software - InfographicHr365.us smith
 
Automate your Kamailio Test Calls - Kamailio World 2024
Automate your Kamailio Test Calls - Kamailio World 2024Automate your Kamailio Test Calls - Kamailio World 2024
Automate your Kamailio Test Calls - Kamailio World 2024Andreas Granig
 
Call Girls in Naraina Delhi 💯Call Us 🔝8264348440🔝
Call Girls in Naraina Delhi 💯Call Us 🔝8264348440🔝Call Girls in Naraina Delhi 💯Call Us 🔝8264348440🔝
Call Girls in Naraina Delhi 💯Call Us 🔝8264348440🔝soniya singh
 
Adobe Marketo Engage Deep Dives: Using Webhooks to Transfer Data
Adobe Marketo Engage Deep Dives: Using Webhooks to Transfer DataAdobe Marketo Engage Deep Dives: Using Webhooks to Transfer Data
Adobe Marketo Engage Deep Dives: Using Webhooks to Transfer DataBradBedford3
 
(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...
(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...
(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...gurkirankumar98700
 
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...kellynguyen01
 
BATTLEFIELD ORM: TIPS, TACTICS AND STRATEGIES FOR CONQUERING YOUR DATABASE
BATTLEFIELD ORM: TIPS, TACTICS AND STRATEGIES FOR CONQUERING YOUR DATABASEBATTLEFIELD ORM: TIPS, TACTICS AND STRATEGIES FOR CONQUERING YOUR DATABASE
BATTLEFIELD ORM: TIPS, TACTICS AND STRATEGIES FOR CONQUERING YOUR DATABASEOrtus Solutions, Corp
 
Alluxio Monthly Webinar | Cloud-Native Model Training on Distributed Data
Alluxio Monthly Webinar | Cloud-Native Model Training on Distributed DataAlluxio Monthly Webinar | Cloud-Native Model Training on Distributed Data
Alluxio Monthly Webinar | Cloud-Native Model Training on Distributed DataAlluxio, Inc.
 
Advancing Engineering with AI through the Next Generation of Strategic Projec...
Advancing Engineering with AI through the Next Generation of Strategic Projec...Advancing Engineering with AI through the Next Generation of Strategic Projec...
Advancing Engineering with AI through the Next Generation of Strategic Projec...OnePlan Solutions
 
What is Fashion PLM and Why Do You Need It
What is Fashion PLM and Why Do You Need ItWhat is Fashion PLM and Why Do You Need It
What is Fashion PLM and Why Do You Need ItWave PLM
 
why an Opensea Clone Script might be your perfect match.pdf
why an Opensea Clone Script might be your perfect match.pdfwhy an Opensea Clone Script might be your perfect match.pdf
why an Opensea Clone Script might be your perfect match.pdfjoe51371421
 

Recently uploaded (20)

Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...
 
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...
 
Call Girls In Mukherjee Nagar 📱 9999965857 🤩 Delhi 🫦 HOT AND SEXY VVIP 🍎 SE...
Call Girls In Mukherjee Nagar 📱  9999965857  🤩 Delhi 🫦 HOT AND SEXY VVIP 🍎 SE...Call Girls In Mukherjee Nagar 📱  9999965857  🤩 Delhi 🫦 HOT AND SEXY VVIP 🍎 SE...
Call Girls In Mukherjee Nagar 📱 9999965857 🤩 Delhi 🫦 HOT AND SEXY VVIP 🍎 SE...
 
Implementing Zero Trust strategy with Azure
Implementing Zero Trust strategy with AzureImplementing Zero Trust strategy with Azure
Implementing Zero Trust strategy with Azure
 
XpertSolvers: Your Partner in Building Innovative Software Solutions
XpertSolvers: Your Partner in Building Innovative Software SolutionsXpertSolvers: Your Partner in Building Innovative Software Solutions
XpertSolvers: Your Partner in Building Innovative Software Solutions
 
Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...
Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...
Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...
 
What are the features of Vehicle Tracking System?
What are the features of Vehicle Tracking System?What are the features of Vehicle Tracking System?
What are the features of Vehicle Tracking System?
 
KnowAPIs-UnknownPerf-jaxMainz-2024 (1).pptx
KnowAPIs-UnknownPerf-jaxMainz-2024 (1).pptxKnowAPIs-UnknownPerf-jaxMainz-2024 (1).pptx
KnowAPIs-UnknownPerf-jaxMainz-2024 (1).pptx
 
Intelligent Home Wi-Fi Solutions | ThinkPalm
Intelligent Home Wi-Fi Solutions | ThinkPalmIntelligent Home Wi-Fi Solutions | ThinkPalm
Intelligent Home Wi-Fi Solutions | ThinkPalm
 
Asset Management Software - Infographic
Asset Management Software - InfographicAsset Management Software - Infographic
Asset Management Software - Infographic
 
Automate your Kamailio Test Calls - Kamailio World 2024
Automate your Kamailio Test Calls - Kamailio World 2024Automate your Kamailio Test Calls - Kamailio World 2024
Automate your Kamailio Test Calls - Kamailio World 2024
 
Call Girls in Naraina Delhi 💯Call Us 🔝8264348440🔝
Call Girls in Naraina Delhi 💯Call Us 🔝8264348440🔝Call Girls in Naraina Delhi 💯Call Us 🔝8264348440🔝
Call Girls in Naraina Delhi 💯Call Us 🔝8264348440🔝
 
Adobe Marketo Engage Deep Dives: Using Webhooks to Transfer Data
Adobe Marketo Engage Deep Dives: Using Webhooks to Transfer DataAdobe Marketo Engage Deep Dives: Using Webhooks to Transfer Data
Adobe Marketo Engage Deep Dives: Using Webhooks to Transfer Data
 
(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...
(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...
(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...
 
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...
 
BATTLEFIELD ORM: TIPS, TACTICS AND STRATEGIES FOR CONQUERING YOUR DATABASE
BATTLEFIELD ORM: TIPS, TACTICS AND STRATEGIES FOR CONQUERING YOUR DATABASEBATTLEFIELD ORM: TIPS, TACTICS AND STRATEGIES FOR CONQUERING YOUR DATABASE
BATTLEFIELD ORM: TIPS, TACTICS AND STRATEGIES FOR CONQUERING YOUR DATABASE
 
Alluxio Monthly Webinar | Cloud-Native Model Training on Distributed Data
Alluxio Monthly Webinar | Cloud-Native Model Training on Distributed DataAlluxio Monthly Webinar | Cloud-Native Model Training on Distributed Data
Alluxio Monthly Webinar | Cloud-Native Model Training on Distributed Data
 
Advancing Engineering with AI through the Next Generation of Strategic Projec...
Advancing Engineering with AI through the Next Generation of Strategic Projec...Advancing Engineering with AI through the Next Generation of Strategic Projec...
Advancing Engineering with AI through the Next Generation of Strategic Projec...
 
What is Fashion PLM and Why Do You Need It
What is Fashion PLM and Why Do You Need ItWhat is Fashion PLM and Why Do You Need It
What is Fashion PLM and Why Do You Need It
 
why an Opensea Clone Script might be your perfect match.pdf
why an Opensea Clone Script might be your perfect match.pdfwhy an Opensea Clone Script might be your perfect match.pdf
why an Opensea Clone Script might be your perfect match.pdf
 

Automation testing using Sikuli

  • 1. Sikuli Mohd Shahabuddin Page 1 What is Sikuli?  Automation scripting tool  Supports Python, Ruby and Java language  Runs on Mac, Linux/Unix and Windows Why Sikuli?  Automates anything you see on the screen of your desktop computer running Windows, Mac or Linux/Unix.  It uses image recognition to identify and control GUI components.  Sikuli is the only option when there is no way to identify web elements  It can run the mouse and the keyboard to interact with the identified GUI elements. History:  Open-source research project.  Started at MIT  Started by Tsung-Hsiang Chang and Tom Yeh What are the prerequisite to learn Sikuli?  Any scripting language with selenium web driver How to install Sikuli in maven project? Step-1:  Add the following dependency in pom.xml file <dependency> <groupId>org.sikuli</groupId> <artifactId>sikuli-java</artifactId> <version>1.0.1</version>
  • 2. Sikuli Mohd Shahabuddin Page 2 </dependency>  If not downloaded automatically during maven clean install then manually download 'sikuli-java.jar' and save it on specific location say ‘c:sikulisikuli- java.jar’ i) Open command prompt. ii) Run the below command. mvn install:install-file -Dfile= c:sikulisikuli-java.jar -DgroupId=org.sikuli - DartifactId=sikuli-java -Dversion=1.0.1 -Dpackaging=jar -DgeneratePom=true iii) If you don’t see 'build successful' then re-trace your steps. Step-2  Go to the local repository of the user and verify the following files present: How to type a text in a text field when using element locator? Step-1
  • 3. Sikuli Mohd Shahabuddin Page 3  Go to the google screen shown below: Step-2  Create a test to type text ‘Hello World’ in google search text field. @Test() public void sikuliTest() throws Exception { Screen s = new Screen(); s.type("Hello World"); }  Run as TestNG test
  • 4. Sikuli Mohd Shahabuddin Page 4 Step-3  See text is typed in browser’s URL instead of google search text field because Skilui captures entire screen and find a first text field anywhere on the screen and perform the action on it. How To distinguish one image from other and perform action on it? Step-1  Let us create a test to type a text ‘Hello World’ in Google’s search text field  Copy the portion of Google’s screen where we have search text field as shown below in a .png file using MS Paint. Let file is saved in location c:google‘GoogleTextField.png’  Saved file loacation
  • 5. Sikuli Mohd Shahabuddin Page 5 v Step-2  Write a test to first verify the desired text field presence and then type a text into it. @Test() public void sikuliTest() throws Exception { String googleSearchTextFieldFilePath="C:/google/GoogleTextField.png"; Thread.sleep(2000); Region r = new Screen(); //saved pattern on drive Pattern savedPattern = new Pattern(googleSearchTextFieldFilePath); //set the percentage of matching intensity. 0.8 is the maximum match value savedPattern = savedPattern.similar(0.8f); //check whether saved pattern is present on the current screen with expected matching intensity( i.e 8). //If match not found Null is returned Match match = r.exists(savedPattern, 8); logger.info("Pattern " + googleSearchTextFieldFilePath + "->" + match); Assert.assertNotNull(match, "pattern "+googleSearchTextFieldFilePath+" not found"); //to set the focus to google search text field r.keyDown(KeyEvent.VK_ENTER); //wait a bit Thread.sleep(2000); //type the desired text into matching pattern r.type("Hello World"); }  Right click and run as TextNG. Below is the output where test is typing text into desired location
  • 6. Sikuli Mohd Shahabuddin Page 6 Further practices  There are many APIs that can be used as per the requirement. Below screen shows few of them: