Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
SlideShare a Scribd company logo
SWTBot: Unit Testing Made EasyEclipse Day India 2011Ankit Goel6th May, 2011
AgendaPART I – About SWTBotIntroduction to SWTBotSWTBot FeaturesSupported WidgetsTest ExecutionsPART II - Integrating SWTBot tests execution with continuous build systemWhat more?Limitations
PART I – About SWTBot
Introduction – What is SWTBot?Java based UI/functional testing tool for testing SWT and Eclipse based applicationsSet of API’s to access and manipulate widgetsCross platformFree and open sourceStill in Incubation Phase in Eclipse
Introduction – Why SWTBot?Why not QTP? Why not PDE Junit? Why not…Provides an intuitive way to access and test UI components in EclipseUI Testing covers all layers of softwareEasy to learn if someone is already familiar with Java and JUnitCan integrate very well within the IDE and provides excellent support for integration with Ant
Introduction – Who is it for?DevelopersUnit testsIntegration with build ensures quality buildsQATest automationQuality product
Setting up Eclipse environmentSWTBot update sitehttp://www.eclipse.org/swtbot/downloads.phpCreate a plugin project and setup dependenciesorg.eclipse.uiorg.eclipse.core.runtimeorg.eclipse.swtbot.eclipse.finderorg.eclipse.swtbot.junit4_xorg.eclipse.swtbot.swt.finderorg.junit4org.hamcrestOr, create a SWTBot test plugin
How does it work?SWTBot = bot which acts on SWT componentsEntry point: org.eclipse.swtbot.eclipse.finder.SWTWorkbenchBotHelper classes for widgetsTo test:Instantiate botSWTWorkbenchBotbot = new SWTWorkbenchBot();Click on buttonSWTBotButton button = bot.button("Hello, World!“);button.click();Congrats! You have just written your first SWTBOT test 
SWTBot FeaturesFinding controls based on visual cuesSupport for simulated mouse and keyboard inputQuerying widgets for stateUI specific assertions like: assertEnabled(Widget)Investigating test failures
SWTBot Features – Finding ControlsControls can be found based on visual cues like:TextLabelGroupTooltipIdsCombination of all or any of the above (Using matchers)Eg:Find textbox that has a label 'Username:‘SWTBotText username = bot.textWithLabel("Username:"); Identify button using tooltip SWTBotToolbarButton save = bot.toolbarButtonWithTooltip("Save");
SWTBot Features – Using matchersSimple matcherswithText(“Finish”)withLabel(“Username:”)withRegex(“Proceed to step * ”)widgetOfType(Button.class)withStyle(SWT.ARROW, “SWT.ARROW”)Combination of matchersallOf(matchers)anyOf(matchers)not(matchers)
Filtering controls using MatchersMatch : widgets of type 'Label' 	with regular expression 'Welcome, <USERNAME>' Matcher matcher = allOf( widgetOfType(Label.class), withRegex("Welcome, .*") ); Get the label that matches the matcher SWTBotLabel label = 	new SWTBotLabel((Label) bot.widget(matcher));
SWTBot Features – Simulate input  SWTBot provides API to simulate actions on widgetsEg:Click a buttonbutton.click(); Select a item in comboboxcomboBox.select(“Option 12"); Type in a textboxtext.typeText(“This is a demo string"); Expand treetree.expandNode("MyProject", "src", "com", "example", "MyClass.java");
SWTBot Features – Querying widgetsProvides operations to query the state of widgetsSome generic queries like: getText(), isEnabled(), isVisible() are available on all widgetsEg:Check state of a checkboxbooleanchecked = checkbox.isChecked();Check if a radio button is selectedboolean selected = radio.isSelected();
SWTBot Features – Investigating test failuresStack trace in Junit viewCapturing screen shot when test case fails@RunWith(SWTBotJunit4ClassRunner.class)publicclassMessageCreateTest{... …}
Supported WidgetsSupport for most SWT controlsSupport for most UI operations on SWT controlsSupport for Eclipse based contributions:ViewsText Editors (autocompletion, typing, etc)View Toolbars and View Menus
SWT Test ExecutionBy launching them from launch configuration (same as Junit execution)From command line, using shell script or ant
DemoA small SWTBot example illustrating the simplicity of SWTBotYour first SWTBot
PART II – Integrating SWTBot tests execution with continuous build system
Integration of test execution with continuous buildBuild plugins to be testedBuild SWTBot test pluginsInstall plugins to be tested, test plugins and headless testing framework (http://www.eclipse.org/swtbot/downloads.php) into eclipseStart SWTBot test case executionFormat the generated report and mail if required
Pre-requisiteEach test plugin must contain test.xmlSet appropriate propertiesDelegate execution of test to a library fileTest plugins should always be ‘unpacked’
Under the covers…For each test pluginInvoke test.xml which willSet required properties like class name, plugin name, directory to use as temp workspace etcInvoke target ‘swtbot-test’ of library file located in ‘org.eclipse.swtbot.eclipse.junit4.headless’ plugin which will then launch and execute all test casesInvoke target ‘collect’ of library file located in ‘org.eclipse.swtbot.eclipse.junit4.headless’ plugin which will consolidate test case results in one fileFormat the generated results file (xml file) into desired format (usually html)
Snippet – test.xml<anttarget="swtbot-test"antfile="${library-file}"dir="${eclipse-home}">	<property name="data-dir"value="${temp-workspace}" />	<propertyname="plugin-name"value="${plugin-name}" />	<propertyname="classname”value=“${class-name}" />	<propertyname="vmargs"value=" -Xms128M -Xmx368M -	XX:MaxPermSize=256M" /></ant>
Still confused ?This would surely help
What more?Parse results file and fail build if any of the test fails – ensuring only quality builds go to QACode Coverage – write more tests to test uncovered code
LimitationsLess documentation availableSome SWT widgets not supported yet!No support for other UI toolkits – GEF, Nebula etc
SwtBot: Unit Testing Made Easy

More Related Content

What's hot

Qa exploratory test charter template
Qa exploratory test charter templateQa exploratory test charter template
Qa exploratory test charter template
Rob Swoboda
 
Automated Web Testing Using Selenium
Automated Web Testing Using SeleniumAutomated Web Testing Using Selenium
Automated Web Testing Using Selenium
Weifeng Zhang
 
MUTANTS KILLER (Revised) - PIT: state of the art of mutation testing system
MUTANTS KILLER (Revised) - PIT: state of the art of mutation testing system MUTANTS KILLER (Revised) - PIT: state of the art of mutation testing system
MUTANTS KILLER (Revised) - PIT: state of the art of mutation testing system
Tarin Gamberini
 
20150306 파이썬기초 IPython을이용한프로그래밍_이태영
20150306 파이썬기초 IPython을이용한프로그래밍_이태영20150306 파이썬기초 IPython을이용한프로그래밍_이태영
20150306 파이썬기초 IPython을이용한프로그래밍_이태영
Tae Young Lee
 
java script json
java script jsonjava script json
java script json
chauhankapil
 
JavaScript Engines and Event Loop
JavaScript Engines and Event Loop JavaScript Engines and Event Loop
JavaScript Engines and Event Loop
Tapan B.K.
 
Introduce Katalon tool
Introduce Katalon toolIntroduce Katalon tool
Introduce Katalon tool
재연 김
 
Google Chrome DevTools features overview
Google Chrome DevTools features overviewGoogle Chrome DevTools features overview
Google Chrome DevTools features overview
Oleksii Prohonnyi
 
Automation Testing of Shadow DOM Elements with Katalon Studio
Automation Testing of Shadow DOM Elements with Katalon StudioAutomation Testing of Shadow DOM Elements with Katalon Studio
Automation Testing of Shadow DOM Elements with Katalon Studio
Katalon Studio
 
Page object pattern
Page object patternPage object pattern
Page object pattern
Petro Konopelko
 
Jetpack compose
Jetpack composeJetpack compose
Jetpack compose
LutasLin
 
Introduction to JUnit
Introduction to JUnitIntroduction to JUnit
Introduction to JUnit
Devvrat Shukla
 
Mutation Testing
Mutation TestingMutation Testing
Mutation Testing
ESUG
 
Kotlin Bytecode Generation and Runtime Performance
Kotlin Bytecode Generation and Runtime PerformanceKotlin Bytecode Generation and Runtime Performance
Kotlin Bytecode Generation and Runtime Performance
intelliyole
 
Learning jQuery in 30 minutes
Learning jQuery in 30 minutesLearning jQuery in 30 minutes
Learning jQuery in 30 minutes
Simon Willison
 
React Native
React NativeReact Native
React Native
Craig Jolicoeur
 
Ai in software automation testing - testim.io
Ai in software automation testing - testim.ioAi in software automation testing - testim.io
Ai in software automation testing - testim.io
Aliaa Monier Ismaail
 
JUnit 5
JUnit 5JUnit 5
Error Management: Future vs ZIO
Error Management: Future vs ZIOError Management: Future vs ZIO
Error Management: Future vs ZIO
John De Goes
 

What's hot (19)

Qa exploratory test charter template
Qa exploratory test charter templateQa exploratory test charter template
Qa exploratory test charter template
 
Automated Web Testing Using Selenium
Automated Web Testing Using SeleniumAutomated Web Testing Using Selenium
Automated Web Testing Using Selenium
 
MUTANTS KILLER (Revised) - PIT: state of the art of mutation testing system
MUTANTS KILLER (Revised) - PIT: state of the art of mutation testing system MUTANTS KILLER (Revised) - PIT: state of the art of mutation testing system
MUTANTS KILLER (Revised) - PIT: state of the art of mutation testing system
 
20150306 파이썬기초 IPython을이용한프로그래밍_이태영
20150306 파이썬기초 IPython을이용한프로그래밍_이태영20150306 파이썬기초 IPython을이용한프로그래밍_이태영
20150306 파이썬기초 IPython을이용한프로그래밍_이태영
 
java script json
java script jsonjava script json
java script json
 
JavaScript Engines and Event Loop
JavaScript Engines and Event Loop JavaScript Engines and Event Loop
JavaScript Engines and Event Loop
 
Introduce Katalon tool
Introduce Katalon toolIntroduce Katalon tool
Introduce Katalon tool
 
Google Chrome DevTools features overview
Google Chrome DevTools features overviewGoogle Chrome DevTools features overview
Google Chrome DevTools features overview
 
Automation Testing of Shadow DOM Elements with Katalon Studio
Automation Testing of Shadow DOM Elements with Katalon StudioAutomation Testing of Shadow DOM Elements with Katalon Studio
Automation Testing of Shadow DOM Elements with Katalon Studio
 
Page object pattern
Page object patternPage object pattern
Page object pattern
 
Jetpack compose
Jetpack composeJetpack compose
Jetpack compose
 
Introduction to JUnit
Introduction to JUnitIntroduction to JUnit
Introduction to JUnit
 
Mutation Testing
Mutation TestingMutation Testing
Mutation Testing
 
Kotlin Bytecode Generation and Runtime Performance
Kotlin Bytecode Generation and Runtime PerformanceKotlin Bytecode Generation and Runtime Performance
Kotlin Bytecode Generation and Runtime Performance
 
Learning jQuery in 30 minutes
Learning jQuery in 30 minutesLearning jQuery in 30 minutes
Learning jQuery in 30 minutes
 
React Native
React NativeReact Native
React Native
 
Ai in software automation testing - testim.io
Ai in software automation testing - testim.ioAi in software automation testing - testim.io
Ai in software automation testing - testim.io
 
JUnit 5
JUnit 5JUnit 5
JUnit 5
 
Error Management: Future vs ZIO
Error Management: Future vs ZIOError Management: Future vs ZIO
Error Management: Future vs ZIO
 

Viewers also liked

Functional Testing made easy with SWTBot for Developers and Testers
Functional Testing made easy with SWTBot for Developers and TestersFunctional Testing made easy with SWTBot for Developers and Testers
Functional Testing made easy with SWTBot for Developers and Testers
Aurélien Pupier
 
Soial culture
Soial cultureSoial culture
Soial culture
Òrsida Sevo
 
Healthy Homes
Healthy HomesHealthy Homes
Healthy Homes
HealthyHomes
 
p
pp
Bni edsonluciano-apr
Bni edsonluciano-aprBni edsonluciano-apr
Bni edsonluciano-apr
Luciano Senise
 
проблеми на основање на ново претпријатие 2
проблеми на основање на ново претпријатие  2проблеми на основање на ново претпријатие  2
проблеми на основање на ново претпријатие 2
samo_ti
 
Avaliação de história di
Avaliação de história diAvaliação de história di
Avaliação de história di
Lais Regina Casquel
 
Avani Realtors and Developers
Avani Realtors and DevelopersAvani Realtors and Developers
Avani Realtors and Developers
Atul Vaja
 
S first year orientation history of university of san carlos 1 - copy
S first year orientation history of university of san carlos 1 - copyS first year orientation history of university of san carlos 1 - copy
S first year orientation history of university of san carlos 1 - copy
Sis Mmfe Navarro
 
Enigma & radar
Enigma & radarEnigma & radar
Enigma & radar
Johnny Xiong
 
Правописание приставок. ЕГЭ задание 9
Правописание приставок. ЕГЭ задание 9Правописание приставок. ЕГЭ задание 9
Правописание приставок. ЕГЭ задание 9
Elena Erastova
 
Lista silvai bellini sindaco
Lista silvai bellini sindacoLista silvai bellini sindaco
Lista silvai bellini sindaco
Martina Garberi
 
Countable,uncountable
Countable,uncountableCountable,uncountable
Countable,uncountable
Òrsida Sevo
 
Sustentabilidade no visual merchandising de moda
Sustentabilidade no visual merchandising de modaSustentabilidade no visual merchandising de moda
Sustentabilidade no visual merchandising de moda
MMdaMODA
 
E recruitment kit (eng)
E recruitment kit (eng)E recruitment kit (eng)
E recruitment kit (eng)
maatbk
 
TALLER DE ORIENTACIÓN VOCACIONAL
TALLER DE ORIENTACIÓN VOCACIONALTALLER DE ORIENTACIÓN VOCACIONAL
TALLER DE ORIENTACIÓN VOCACIONAL
M Dolores Camps
 

Viewers also liked (16)

Functional Testing made easy with SWTBot for Developers and Testers
Functional Testing made easy with SWTBot for Developers and TestersFunctional Testing made easy with SWTBot for Developers and Testers
Functional Testing made easy with SWTBot for Developers and Testers
 
Soial culture
Soial cultureSoial culture
Soial culture
 
Healthy Homes
Healthy HomesHealthy Homes
Healthy Homes
 
p
pp
p
 
Bni edsonluciano-apr
Bni edsonluciano-aprBni edsonluciano-apr
Bni edsonluciano-apr
 
проблеми на основање на ново претпријатие 2
проблеми на основање на ново претпријатие  2проблеми на основање на ново претпријатие  2
проблеми на основање на ново претпријатие 2
 
Avaliação de história di
Avaliação de história diAvaliação de história di
Avaliação de história di
 
Avani Realtors and Developers
Avani Realtors and DevelopersAvani Realtors and Developers
Avani Realtors and Developers
 
S first year orientation history of university of san carlos 1 - copy
S first year orientation history of university of san carlos 1 - copyS first year orientation history of university of san carlos 1 - copy
S first year orientation history of university of san carlos 1 - copy
 
Enigma & radar
Enigma & radarEnigma & radar
Enigma & radar
 
Правописание приставок. ЕГЭ задание 9
Правописание приставок. ЕГЭ задание 9Правописание приставок. ЕГЭ задание 9
Правописание приставок. ЕГЭ задание 9
 
Lista silvai bellini sindaco
Lista silvai bellini sindacoLista silvai bellini sindaco
Lista silvai bellini sindaco
 
Countable,uncountable
Countable,uncountableCountable,uncountable
Countable,uncountable
 
Sustentabilidade no visual merchandising de moda
Sustentabilidade no visual merchandising de modaSustentabilidade no visual merchandising de moda
Sustentabilidade no visual merchandising de moda
 
E recruitment kit (eng)
E recruitment kit (eng)E recruitment kit (eng)
E recruitment kit (eng)
 
TALLER DE ORIENTACIÓN VOCACIONAL
TALLER DE ORIENTACIÓN VOCACIONALTALLER DE ORIENTACIÓN VOCACIONAL
TALLER DE ORIENTACIÓN VOCACIONAL
 

Similar to SwtBot: Unit Testing Made Easy

Swtbot
SwtbotSwtbot
Swtbot
cristitep
 
Testing Java Web Apps With Selenium
Testing Java Web Apps With SeleniumTesting Java Web Apps With Selenium
Testing Java Web Apps With Selenium
Marakana Inc.
 
Selenium-Browser-Based-Automated-Testing-for-Grails-Apps
Selenium-Browser-Based-Automated-Testing-for-Grails-AppsSelenium-Browser-Based-Automated-Testing-for-Grails-Apps
Selenium-Browser-Based-Automated-Testing-for-Grails-Apps
chrisb206 chrisb206
 
Mastering Test Automation: How To Use Selenium Successfully
Mastering Test Automation: How To Use Selenium SuccessfullyMastering Test Automation: How To Use Selenium Successfully
Mastering Test Automation: How To Use Selenium Successfully
SpringPeople
 
SoapUI Pro Plugin Workshop #SoapUIPlugins
SoapUI Pro Plugin Workshop #SoapUIPluginsSoapUI Pro Plugin Workshop #SoapUIPlugins
SoapUI Pro Plugin Workshop #SoapUIPlugins
SmartBear
 
Google Web Toolkits
Google Web ToolkitsGoogle Web Toolkits
Google Web Toolkits
Yiguang Hu
 
10071756.ppt
10071756.ppt10071756.ppt
10071756.ppt
Rohit846825
 
JsUnit
JsUnitJsUnit
JsUnit
Alex Chaffee
 
Testing And Drupal
Testing And DrupalTesting And Drupal
Testing And Drupal
Peter Arato
 
Coded ui - lesson 1 - overview
Coded ui - lesson 1 - overviewCoded ui - lesson 1 - overview
Coded ui - lesson 1 - overview
Omer Karpas
 
12 Rational Solo Pruebas 2009
12 Rational Solo Pruebas 200912 Rational Solo Pruebas 2009
12 Rational Solo Pruebas 2009
Pepe
 
Jsunit
JsunitJsunit
Jsunit
david_inapps
 
Unit Testing in Flutter - From Workflow Essentials to Complex Scenarios
Unit Testing in Flutter - From Workflow Essentials to Complex ScenariosUnit Testing in Flutter - From Workflow Essentials to Complex Scenarios
Unit Testing in Flutter - From Workflow Essentials to Complex Scenarios
RubenGray1
 
Automation - web testing with selenium
Automation - web testing with seleniumAutomation - web testing with selenium
Automation - web testing with selenium
Tzirla Rozental
 
Rich GUI Testing: Swing and JavaFX
Rich GUI Testing: Swing and JavaFXRich GUI Testing: Swing and JavaFX
Rich GUI Testing: Swing and JavaFX
Alex Ruiz
 
Rich GUI Testing: Swing and JavaFX
Rich GUI Testing: Swing and JavaFXRich GUI Testing: Swing and JavaFX
Rich GUI Testing: Swing and JavaFX
Alex Ruiz
 
Embrace Unit Testing
Embrace Unit TestingEmbrace Unit Testing
Embrace Unit Testing
alessiopace
 
Testing Options in Java
Testing Options in JavaTesting Options in Java
Testing Options in Java
Michael Fons
 
Selenium Testing with TestingBot.com
Selenium Testing with TestingBot.comSelenium Testing with TestingBot.com
Selenium Testing with TestingBot.com
testingbot
 
Siebel Open UI Debugging (Siebel Open UI Training, Part 7)
Siebel Open UI Debugging (Siebel Open UI Training, Part 7)Siebel Open UI Debugging (Siebel Open UI Training, Part 7)
Siebel Open UI Debugging (Siebel Open UI Training, Part 7)
Tech OneStop
 

Similar to SwtBot: Unit Testing Made Easy (20)

Swtbot
SwtbotSwtbot
Swtbot
 
Testing Java Web Apps With Selenium
Testing Java Web Apps With SeleniumTesting Java Web Apps With Selenium
Testing Java Web Apps With Selenium
 
Selenium-Browser-Based-Automated-Testing-for-Grails-Apps
Selenium-Browser-Based-Automated-Testing-for-Grails-AppsSelenium-Browser-Based-Automated-Testing-for-Grails-Apps
Selenium-Browser-Based-Automated-Testing-for-Grails-Apps
 
Mastering Test Automation: How To Use Selenium Successfully
Mastering Test Automation: How To Use Selenium SuccessfullyMastering Test Automation: How To Use Selenium Successfully
Mastering Test Automation: How To Use Selenium Successfully
 
SoapUI Pro Plugin Workshop #SoapUIPlugins
SoapUI Pro Plugin Workshop #SoapUIPluginsSoapUI Pro Plugin Workshop #SoapUIPlugins
SoapUI Pro Plugin Workshop #SoapUIPlugins
 
Google Web Toolkits
Google Web ToolkitsGoogle Web Toolkits
Google Web Toolkits
 
10071756.ppt
10071756.ppt10071756.ppt
10071756.ppt
 
JsUnit
JsUnitJsUnit
JsUnit
 
Testing And Drupal
Testing And DrupalTesting And Drupal
Testing And Drupal
 
Coded ui - lesson 1 - overview
Coded ui - lesson 1 - overviewCoded ui - lesson 1 - overview
Coded ui - lesson 1 - overview
 
12 Rational Solo Pruebas 2009
12 Rational Solo Pruebas 200912 Rational Solo Pruebas 2009
12 Rational Solo Pruebas 2009
 
Jsunit
JsunitJsunit
Jsunit
 
Unit Testing in Flutter - From Workflow Essentials to Complex Scenarios
Unit Testing in Flutter - From Workflow Essentials to Complex ScenariosUnit Testing in Flutter - From Workflow Essentials to Complex Scenarios
Unit Testing in Flutter - From Workflow Essentials to Complex Scenarios
 
Automation - web testing with selenium
Automation - web testing with seleniumAutomation - web testing with selenium
Automation - web testing with selenium
 
Rich GUI Testing: Swing and JavaFX
Rich GUI Testing: Swing and JavaFXRich GUI Testing: Swing and JavaFX
Rich GUI Testing: Swing and JavaFX
 
Rich GUI Testing: Swing and JavaFX
Rich GUI Testing: Swing and JavaFXRich GUI Testing: Swing and JavaFX
Rich GUI Testing: Swing and JavaFX
 
Embrace Unit Testing
Embrace Unit TestingEmbrace Unit Testing
Embrace Unit Testing
 
Testing Options in Java
Testing Options in JavaTesting Options in Java
Testing Options in Java
 
Selenium Testing with TestingBot.com
Selenium Testing with TestingBot.comSelenium Testing with TestingBot.com
Selenium Testing with TestingBot.com
 
Siebel Open UI Debugging (Siebel Open UI Training, Part 7)
Siebel Open UI Debugging (Siebel Open UI Training, Part 7)Siebel Open UI Debugging (Siebel Open UI Training, Part 7)
Siebel Open UI Debugging (Siebel Open UI Training, Part 7)
 

Recently uploaded

Transcript: Details of description part II: Describing images in practice - T...
Transcript: Details of description part II: Describing images in practice - T...Transcript: Details of description part II: Describing images in practice - T...
Transcript: Details of description part II: Describing images in practice - T...
BookNet Canada
 
Calgary MuleSoft Meetup APM and IDP .pptx
Calgary MuleSoft Meetup APM and IDP .pptxCalgary MuleSoft Meetup APM and IDP .pptx
Calgary MuleSoft Meetup APM and IDP .pptx
ishalveerrandhawa1
 
WhatsApp Image 2024-03-27 at 08.19.52_bfd93109.pdf
WhatsApp Image 2024-03-27 at 08.19.52_bfd93109.pdfWhatsApp Image 2024-03-27 at 08.19.52_bfd93109.pdf
WhatsApp Image 2024-03-27 at 08.19.52_bfd93109.pdf
ArgaBisma
 
The Increasing Use of the National Research Platform by the CSU Campuses
The Increasing Use of the National Research Platform by the CSU CampusesThe Increasing Use of the National Research Platform by the CSU Campuses
The Increasing Use of the National Research Platform by the CSU Campuses
Larry Smarr
 
Details of description part II: Describing images in practice - Tech Forum 2024
Details of description part II: Describing images in practice - Tech Forum 2024Details of description part II: Describing images in practice - Tech Forum 2024
Details of description part II: Describing images in practice - Tech Forum 2024
BookNet Canada
 
Knowledge and Prompt Engineering Part 2 Focus on Prompt Design Approaches
Knowledge and Prompt Engineering Part 2 Focus on Prompt Design ApproachesKnowledge and Prompt Engineering Part 2 Focus on Prompt Design Approaches
Knowledge and Prompt Engineering Part 2 Focus on Prompt Design Approaches
Earley Information Science
 
Cookies program to display the information though cookie creation
Cookies program to display the information though cookie creationCookies program to display the information though cookie creation
Cookies program to display the information though cookie creation
shanthidl1
 
Research Directions for Cross Reality Interfaces
Research Directions for Cross Reality InterfacesResearch Directions for Cross Reality Interfaces
Research Directions for Cross Reality Interfaces
Mark Billinghurst
 
Scaling Connections in PostgreSQL Postgres Bangalore(PGBLR) Meetup-2 - Mydbops
Scaling Connections in PostgreSQL Postgres Bangalore(PGBLR) Meetup-2 - MydbopsScaling Connections in PostgreSQL Postgres Bangalore(PGBLR) Meetup-2 - Mydbops
Scaling Connections in PostgreSQL Postgres Bangalore(PGBLR) Meetup-2 - Mydbops
Mydbops
 
“Intel’s Approach to Operationalizing AI in the Manufacturing Sector,” a Pres...
“Intel’s Approach to Operationalizing AI in the Manufacturing Sector,” a Pres...“Intel’s Approach to Operationalizing AI in the Manufacturing Sector,” a Pres...
“Intel’s Approach to Operationalizing AI in the Manufacturing Sector,” a Pres...
Edge AI and Vision Alliance
 
MYIR Product Brochure - A Global Provider of Embedded SOMs & Solutions
MYIR Product Brochure - A Global Provider of Embedded SOMs & SolutionsMYIR Product Brochure - A Global Provider of Embedded SOMs & Solutions
MYIR Product Brochure - A Global Provider of Embedded SOMs & Solutions
Linda Zhang
 
Pigging Solutions Sustainability brochure.pdf
Pigging Solutions Sustainability brochure.pdfPigging Solutions Sustainability brochure.pdf
Pigging Solutions Sustainability brochure.pdf
Pigging Solutions
 
Quality Patents: Patents That Stand the Test of Time
Quality Patents: Patents That Stand the Test of TimeQuality Patents: Patents That Stand the Test of Time
Quality Patents: Patents That Stand the Test of Time
Aurora Consulting
 
20240702 QFM021 Machine Intelligence Reading List June 2024
20240702 QFM021 Machine Intelligence Reading List June 202420240702 QFM021 Machine Intelligence Reading List June 2024
20240702 QFM021 Machine Intelligence Reading List June 2024
Matthew Sinclair
 
Quantum Communications Q&A with Gemini LLM
Quantum Communications Q&A with Gemini LLMQuantum Communications Q&A with Gemini LLM
Quantum Communications Q&A with Gemini LLM
Vijayananda Mohire
 
20240705 QFM024 Irresponsible AI Reading List June 2024
20240705 QFM024 Irresponsible AI Reading List June 202420240705 QFM024 Irresponsible AI Reading List June 2024
20240705 QFM024 Irresponsible AI Reading List June 2024
Matthew Sinclair
 
Recent Advancements in the NIST-JARVIS Infrastructure
Recent Advancements in the NIST-JARVIS InfrastructureRecent Advancements in the NIST-JARVIS Infrastructure
Recent Advancements in the NIST-JARVIS Infrastructure
KAMAL CHOUDHARY
 
What's Next Web Development Trends to Watch.pdf
What's Next Web Development Trends to Watch.pdfWhat's Next Web Development Trends to Watch.pdf
What's Next Web Development Trends to Watch.pdf
SeasiaInfotech2
 
@Call @Girls Thiruvananthapuram 🚒 XXXXXXXXXX 🚒 Priya Sharma Beautiful And Cu...
@Call @Girls Thiruvananthapuram  🚒 XXXXXXXXXX 🚒 Priya Sharma Beautiful And Cu...@Call @Girls Thiruvananthapuram  🚒 XXXXXXXXXX 🚒 Priya Sharma Beautiful And Cu...
@Call @Girls Thiruvananthapuram 🚒 XXXXXXXXXX 🚒 Priya Sharma Beautiful And Cu...
kantakumariji156
 
GDG Cloud Southlake #34: Neatsun Ziv: Automating Appsec
GDG Cloud Southlake #34: Neatsun Ziv: Automating AppsecGDG Cloud Southlake #34: Neatsun Ziv: Automating Appsec
GDG Cloud Southlake #34: Neatsun Ziv: Automating Appsec
James Anderson
 

Recently uploaded (20)

Transcript: Details of description part II: Describing images in practice - T...
Transcript: Details of description part II: Describing images in practice - T...Transcript: Details of description part II: Describing images in practice - T...
Transcript: Details of description part II: Describing images in practice - T...
 
Calgary MuleSoft Meetup APM and IDP .pptx
Calgary MuleSoft Meetup APM and IDP .pptxCalgary MuleSoft Meetup APM and IDP .pptx
Calgary MuleSoft Meetup APM and IDP .pptx
 
WhatsApp Image 2024-03-27 at 08.19.52_bfd93109.pdf
WhatsApp Image 2024-03-27 at 08.19.52_bfd93109.pdfWhatsApp Image 2024-03-27 at 08.19.52_bfd93109.pdf
WhatsApp Image 2024-03-27 at 08.19.52_bfd93109.pdf
 
The Increasing Use of the National Research Platform by the CSU Campuses
The Increasing Use of the National Research Platform by the CSU CampusesThe Increasing Use of the National Research Platform by the CSU Campuses
The Increasing Use of the National Research Platform by the CSU Campuses
 
Details of description part II: Describing images in practice - Tech Forum 2024
Details of description part II: Describing images in practice - Tech Forum 2024Details of description part II: Describing images in practice - Tech Forum 2024
Details of description part II: Describing images in practice - Tech Forum 2024
 
Knowledge and Prompt Engineering Part 2 Focus on Prompt Design Approaches
Knowledge and Prompt Engineering Part 2 Focus on Prompt Design ApproachesKnowledge and Prompt Engineering Part 2 Focus on Prompt Design Approaches
Knowledge and Prompt Engineering Part 2 Focus on Prompt Design Approaches
 
Cookies program to display the information though cookie creation
Cookies program to display the information though cookie creationCookies program to display the information though cookie creation
Cookies program to display the information though cookie creation
 
Research Directions for Cross Reality Interfaces
Research Directions for Cross Reality InterfacesResearch Directions for Cross Reality Interfaces
Research Directions for Cross Reality Interfaces
 
Scaling Connections in PostgreSQL Postgres Bangalore(PGBLR) Meetup-2 - Mydbops
Scaling Connections in PostgreSQL Postgres Bangalore(PGBLR) Meetup-2 - MydbopsScaling Connections in PostgreSQL Postgres Bangalore(PGBLR) Meetup-2 - Mydbops
Scaling Connections in PostgreSQL Postgres Bangalore(PGBLR) Meetup-2 - Mydbops
 
“Intel’s Approach to Operationalizing AI in the Manufacturing Sector,” a Pres...
“Intel’s Approach to Operationalizing AI in the Manufacturing Sector,” a Pres...“Intel’s Approach to Operationalizing AI in the Manufacturing Sector,” a Pres...
“Intel’s Approach to Operationalizing AI in the Manufacturing Sector,” a Pres...
 
MYIR Product Brochure - A Global Provider of Embedded SOMs & Solutions
MYIR Product Brochure - A Global Provider of Embedded SOMs & SolutionsMYIR Product Brochure - A Global Provider of Embedded SOMs & Solutions
MYIR Product Brochure - A Global Provider of Embedded SOMs & Solutions
 
Pigging Solutions Sustainability brochure.pdf
Pigging Solutions Sustainability brochure.pdfPigging Solutions Sustainability brochure.pdf
Pigging Solutions Sustainability brochure.pdf
 
Quality Patents: Patents That Stand the Test of Time
Quality Patents: Patents That Stand the Test of TimeQuality Patents: Patents That Stand the Test of Time
Quality Patents: Patents That Stand the Test of Time
 
20240702 QFM021 Machine Intelligence Reading List June 2024
20240702 QFM021 Machine Intelligence Reading List June 202420240702 QFM021 Machine Intelligence Reading List June 2024
20240702 QFM021 Machine Intelligence Reading List June 2024
 
Quantum Communications Q&A with Gemini LLM
Quantum Communications Q&A with Gemini LLMQuantum Communications Q&A with Gemini LLM
Quantum Communications Q&A with Gemini LLM
 
20240705 QFM024 Irresponsible AI Reading List June 2024
20240705 QFM024 Irresponsible AI Reading List June 202420240705 QFM024 Irresponsible AI Reading List June 2024
20240705 QFM024 Irresponsible AI Reading List June 2024
 
Recent Advancements in the NIST-JARVIS Infrastructure
Recent Advancements in the NIST-JARVIS InfrastructureRecent Advancements in the NIST-JARVIS Infrastructure
Recent Advancements in the NIST-JARVIS Infrastructure
 
What's Next Web Development Trends to Watch.pdf
What's Next Web Development Trends to Watch.pdfWhat's Next Web Development Trends to Watch.pdf
What's Next Web Development Trends to Watch.pdf
 
@Call @Girls Thiruvananthapuram 🚒 XXXXXXXXXX 🚒 Priya Sharma Beautiful And Cu...
@Call @Girls Thiruvananthapuram  🚒 XXXXXXXXXX 🚒 Priya Sharma Beautiful And Cu...@Call @Girls Thiruvananthapuram  🚒 XXXXXXXXXX 🚒 Priya Sharma Beautiful And Cu...
@Call @Girls Thiruvananthapuram 🚒 XXXXXXXXXX 🚒 Priya Sharma Beautiful And Cu...
 
GDG Cloud Southlake #34: Neatsun Ziv: Automating Appsec
GDG Cloud Southlake #34: Neatsun Ziv: Automating AppsecGDG Cloud Southlake #34: Neatsun Ziv: Automating Appsec
GDG Cloud Southlake #34: Neatsun Ziv: Automating Appsec
 

SwtBot: Unit Testing Made Easy

  • 1. SWTBot: Unit Testing Made EasyEclipse Day India 2011Ankit Goel6th May, 2011
  • 2. AgendaPART I – About SWTBotIntroduction to SWTBotSWTBot FeaturesSupported WidgetsTest ExecutionsPART II - Integrating SWTBot tests execution with continuous build systemWhat more?Limitations
  • 3. PART I – About SWTBot
  • 4. Introduction – What is SWTBot?Java based UI/functional testing tool for testing SWT and Eclipse based applicationsSet of API’s to access and manipulate widgetsCross platformFree and open sourceStill in Incubation Phase in Eclipse
  • 5. Introduction – Why SWTBot?Why not QTP? Why not PDE Junit? Why not…Provides an intuitive way to access and test UI components in EclipseUI Testing covers all layers of softwareEasy to learn if someone is already familiar with Java and JUnitCan integrate very well within the IDE and provides excellent support for integration with Ant
  • 6. Introduction – Who is it for?DevelopersUnit testsIntegration with build ensures quality buildsQATest automationQuality product
  • 7. Setting up Eclipse environmentSWTBot update sitehttp://www.eclipse.org/swtbot/downloads.phpCreate a plugin project and setup dependenciesorg.eclipse.uiorg.eclipse.core.runtimeorg.eclipse.swtbot.eclipse.finderorg.eclipse.swtbot.junit4_xorg.eclipse.swtbot.swt.finderorg.junit4org.hamcrestOr, create a SWTBot test plugin
  • 8. How does it work?SWTBot = bot which acts on SWT componentsEntry point: org.eclipse.swtbot.eclipse.finder.SWTWorkbenchBotHelper classes for widgetsTo test:Instantiate botSWTWorkbenchBotbot = new SWTWorkbenchBot();Click on buttonSWTBotButton button = bot.button("Hello, World!“);button.click();Congrats! You have just written your first SWTBOT test 
  • 9. SWTBot FeaturesFinding controls based on visual cuesSupport for simulated mouse and keyboard inputQuerying widgets for stateUI specific assertions like: assertEnabled(Widget)Investigating test failures
  • 10. SWTBot Features – Finding ControlsControls can be found based on visual cues like:TextLabelGroupTooltipIdsCombination of all or any of the above (Using matchers)Eg:Find textbox that has a label 'Username:‘SWTBotText username = bot.textWithLabel("Username:"); Identify button using tooltip SWTBotToolbarButton save = bot.toolbarButtonWithTooltip("Save");
  • 11. SWTBot Features – Using matchersSimple matcherswithText(“Finish”)withLabel(“Username:”)withRegex(“Proceed to step * ”)widgetOfType(Button.class)withStyle(SWT.ARROW, “SWT.ARROW”)Combination of matchersallOf(matchers)anyOf(matchers)not(matchers)
  • 12. Filtering controls using MatchersMatch : widgets of type 'Label' with regular expression 'Welcome, <USERNAME>' Matcher matcher = allOf( widgetOfType(Label.class), withRegex("Welcome, .*") ); Get the label that matches the matcher SWTBotLabel label = new SWTBotLabel((Label) bot.widget(matcher));
  • 13. SWTBot Features – Simulate input SWTBot provides API to simulate actions on widgetsEg:Click a buttonbutton.click(); Select a item in comboboxcomboBox.select(“Option 12"); Type in a textboxtext.typeText(“This is a demo string"); Expand treetree.expandNode("MyProject", "src", "com", "example", "MyClass.java");
  • 14. SWTBot Features – Querying widgetsProvides operations to query the state of widgetsSome generic queries like: getText(), isEnabled(), isVisible() are available on all widgetsEg:Check state of a checkboxbooleanchecked = checkbox.isChecked();Check if a radio button is selectedboolean selected = radio.isSelected();
  • 15. SWTBot Features – Investigating test failuresStack trace in Junit viewCapturing screen shot when test case fails@RunWith(SWTBotJunit4ClassRunner.class)publicclassMessageCreateTest{... …}
  • 16. Supported WidgetsSupport for most SWT controlsSupport for most UI operations on SWT controlsSupport for Eclipse based contributions:ViewsText Editors (autocompletion, typing, etc)View Toolbars and View Menus
  • 17. SWT Test ExecutionBy launching them from launch configuration (same as Junit execution)From command line, using shell script or ant
  • 18. DemoA small SWTBot example illustrating the simplicity of SWTBotYour first SWTBot
  • 19. PART II – Integrating SWTBot tests execution with continuous build system
  • 20. Integration of test execution with continuous buildBuild plugins to be testedBuild SWTBot test pluginsInstall plugins to be tested, test plugins and headless testing framework (http://www.eclipse.org/swtbot/downloads.php) into eclipseStart SWTBot test case executionFormat the generated report and mail if required
  • 21. Pre-requisiteEach test plugin must contain test.xmlSet appropriate propertiesDelegate execution of test to a library fileTest plugins should always be ‘unpacked’
  • 22. Under the covers…For each test pluginInvoke test.xml which willSet required properties like class name, plugin name, directory to use as temp workspace etcInvoke target ‘swtbot-test’ of library file located in ‘org.eclipse.swtbot.eclipse.junit4.headless’ plugin which will then launch and execute all test casesInvoke target ‘collect’ of library file located in ‘org.eclipse.swtbot.eclipse.junit4.headless’ plugin which will consolidate test case results in one fileFormat the generated results file (xml file) into desired format (usually html)
  • 23. Snippet – test.xml<anttarget="swtbot-test"antfile="${library-file}"dir="${eclipse-home}"> <property name="data-dir"value="${temp-workspace}" /> <propertyname="plugin-name"value="${plugin-name}" /> <propertyname="classname”value=“${class-name}" /> <propertyname="vmargs"value=" -Xms128M -Xmx368M - XX:MaxPermSize=256M" /></ant>
  • 24. Still confused ?This would surely help
  • 25. What more?Parse results file and fail build if any of the test fails – ensuring only quality builds go to QACode Coverage – write more tests to test uncovered code
  • 26. LimitationsLess documentation availableSome SWT widgets not supported yet!No support for other UI toolkits – GEF, Nebula etc

Editor's Notes

  1. QTP:Pre-work required – repositoryNot cross platform – runs only on windows – no linux supportEven though its one of the fastest tools in the market – its still slower than SWTBotLearning requiredBetter because multiple types of apps can be supportedSWTBot provides APIs that are simple to read and write.No-hassle tool for writing powerful tests
  2. SWTBot provides APIs that are simple to read and write. These APIs hide away the complexities of SWT and Eclipse. This makes it suitable for use by everyone and not just developers.
  3. If you scroll down the stack trace in the JUnit view, you’ll see the cause of the error.The@RunWith(SWTBotJunit4ClassRunner.class)annotation captures a screenshot in a screenshots directory in your project. Refresh your project to see the new folder.
  4. List of Not Yet Supported SWT WidgetsButton Arrow,Browser,Canvas,Composite,CTabFolder,Link,ProgressBar,Sash,Scale, ScrolledComposite,Slider,Spinner,TabFolderNot Yet Supported UI ToolkitsGEFEclipse FormsNebulaeSWT &amp; eRCPRAP (work in progress)Native Dialogs (MessageBox, FileDialog, ColorDialog etc.)Most of it is planned to be supported them ASAP
  5. A demo mapping all the theory learnt so far into a practical example
  6. It&apos;s generally accepted that writing tests as part of software development is a very good thing indeed. It&apos;s also generally accepted that automating the running of tests in an automated or nightly build is good engineering practice. Let&apos;s face it, if tests are not run automatically then there&apos;s a good chance they won&apos;t be run at all, and tests that are not run are next to useless.SWTBot provides an excellent framework to write and run unit tests for your plug-ins that can be run from within the Eclipse environment.Once you have taken the time and effort to write these valuable unit tests, how do you automate the running of these unit tests so that you can integrate them into your automated build?
  7. A demo showing how execution on unit tests can be integrated with the regular build system
  8. List of Not Yet Supported SWT WidgetsButton Arrow,Browser,Canvas,Composite,CTabFolder,Link,ProgressBar,Sash,Scale, ScrolledComposite,Slider,Spinner,TabFolderNot Yet Supported UI ToolkitsGEFEclipse FormsNebulaeSWT &amp; eRCPRAP (work in progress)Native Dialogs (MessageBox, FileDialog, ColorDialog etc.)Most of it is planned to be supported them ASAP