SlideShare a Scribd company logo
Functional Testing made easy
with SWTBot for Developers
and Testers
Aurelien Pupier - @apupier
Studio Development Leader
© 2015 Bonitasoft 2
What is SWTBot?
Java Framework for SWT automated UI tests
© 2015 Bonitasoft 3
And also…
SWTBot – General workings
• Encapsulate UI components
• Send SWT Events to simulate User interaction
4© 2015 Bonitasoft
SWTBot – Sample
5© 2015 Bonitasoft
bot.textWithLabel(“Name *”).setText(“userName”);
bot.comboBox().select(“Text”);
bot.textWithLabel(“Default value”).setText(“john”);
bot.button(“Finish”).click();
SWTBot – Advantages
• Easy to understand for developers
• Easy to write first shot
• … Even a recorder
• Access to Java API for assertions
• Test code coverage
6© 2015 Bonitasoft
SWTBot limitations (1/5)
• Underlying components knowledge
– Widget types
– Eclipse wording
7© 2015 Bonitasoft
Table or List?
Combo or CCombo?
SWTBot limitations (2/5)
• Same widget at different place
– SWTBotConstants.SWTBOT_WIDGET_ID_KEY
– production code modified
8© 2015 Bonitasoft
SWTBot limitations (3/5)
• UI Thread synchronization  Robustness hard:
– Correct implementation of waitUntil required
– (even if Conditions provided)
9© 2015 Bonitasoft
SWTBot limitations (4/5)
• Java code not accessible for Java/Eclipse beginners
– For all previously mentioned reasons
10© 2015 Bonitasoft
SWTBot limitations (5/5)
• Maintenance of tests:
– Requires to be close to production code
• Message updated (to fix a typo)
• UI updated (from Combo to CCombo…)
11© 2015 Bonitasoft
SWTBot conclusion
SWTBot is an handy test tool
for developers
12© 2015 Bonitasoft
What about testers?
• How to let testers writing Functional tests?
– Do not care of implementation details
13© 2015 Bonitasoft
Application Oriented API
‘Page Object Pattern’
14© 2015 Bonitasoft
Application Oriented API
15© 2015 Bonitasoft
Page Pattern sample (1/2)
16© 2015 Bonitasoft
new BotDataDialog().
.setName(“userName”)
.setType(“Text”)
.setDefaultValue(“john”)
.finish();
bot.waitUntil(Conditions.shellIsActive(Messages.newVariable));
SWTBotShell shell = bot.activeShell();
bot.textWithLabel(Messages.name_mandatory).setText(“userName”);
bot.comboBox().select(“Text”);
bot.textWithLabel(Messages.defaultValue).setText(“john”);
bot.button(IDialogConstants.FINISH_LABEL).click();
bot.waitUntil(Conditions.shellCloses(shell));
Page Pattern sample (2/2)
17© 2015 Bonitasoft
new BotDataDialog().
.setName(“userName”)
.setType(“Text”)
.setDefaultValue(“john”)
.finish();
bot.waitUntil(Conditions.shellIsActive(Messages.newVariable));
SWTBotShell shell = bot.activeShell();
bot.textWithLabel(Messages.name_mandatory).setText(“userName”);
bot.comboBox().select(“Text”);
bot.textWithLabel(Messages.defaultValue).setText(“john”);
bot.button(IDialogConstants.FINISH_LABEL).click();
bot.waitUntil(Conditions.shellCloses(shell));
What decided us?
• Successful implementation with Selenium and
Chinese QA team
• Code mess
– Big static utility classes…
– Sometimes right utility class hard to find
• Robustness issue
– CI infra updated  ~10% of UI tests unstable
• Half-day for one test
• Invite QA testers to join the party
• Same tooling Development/QA
18© 2015 Bonitasoft
Observed benefits
Eases writing…
… and maintaining Functional Tests
… for Testers AND Developers
– New UI test: Half-day  1 hour
– More factorized code
– Robustness
19© 2015 Bonitasoft
Feedback on implementation
• Setup time ~3 weeks
• On the fly
20© 2015 Bonitasoft
What’s next?
21© 2015 Bonitasoft
What’s next?
• BDD
– Get stake holders and user advocates to join the party
– Talk about using Cucumber with SWTBot
• RedDeer
– Reuse the Eclipse components
22© 2015 Bonitasoft
Visit us online
bonitasoft.com
Join our community
Bonitasoft.org
Download
Bonitasoft.com/downloads
Follow us on twitter
@bonitasoft
“Page” your App!
@apupier
© 2015 Bonitasoft 23
24© 2015 Bonitasoft

More Related Content

What's hot (20)

PDF
PHP Unit Testing in Yii
IlPeach
 
PPTX
Unit Testing Android Applications
Rody Middelkoop
 
PPT
Automating UI testing
Adam Siton
 
PDF
Efficient JavaScript Unit Testing, May 2012
Hazem Saleh
 
PDF
iOS UI Testing in Xcode
Jz Chang
 
PDF
Tellurium At Rich Web Experience2009
John.Jian.Fang
 
PPTX
Dusan Lukic Magento 2 Integration Tests Meet Magento Serbia 2016
Dusan Lukic
 
PDF
[XCode] Automating UI Testing
Phineas Huang
 
PDF
Codeception presentation
Andrei Burian
 
PDF
Tellurium.A.New.Approach.For.Web.Testing
John.Jian.Fang
 
PPTX
Unit testing on mobile apps
Buşra Deniz, CSM
 
PPTX
Codeception
少東 張
 
PDF
How to setup unit testing in Android Studio
tobiaspreuss
 
PPTX
Protractor framework – how to make stable e2e tests for Angular applications
Ludmila Nesvitiy
 
PPTX
Quickly Testing Qt Desktop Applications
Clare Macrae
 
PDF
Unit Testing on Android - Droidcon Berlin 2015
Buşra Deniz, CSM
 
PDF
Unit-testing and E2E testing in JS
Michael Haberman
 
PDF
Test all the things! Automated testing with Drupal 8
Sam Becker
 
PPT
Unit Testing in iOS
Long Weekend LLC
 
PDF
軟體測試是在測試什麼?
Yao Nien Chung
 
PHP Unit Testing in Yii
IlPeach
 
Unit Testing Android Applications
Rody Middelkoop
 
Automating UI testing
Adam Siton
 
Efficient JavaScript Unit Testing, May 2012
Hazem Saleh
 
iOS UI Testing in Xcode
Jz Chang
 
Tellurium At Rich Web Experience2009
John.Jian.Fang
 
Dusan Lukic Magento 2 Integration Tests Meet Magento Serbia 2016
Dusan Lukic
 
[XCode] Automating UI Testing
Phineas Huang
 
Codeception presentation
Andrei Burian
 
Tellurium.A.New.Approach.For.Web.Testing
John.Jian.Fang
 
Unit testing on mobile apps
Buşra Deniz, CSM
 
Codeception
少東 張
 
How to setup unit testing in Android Studio
tobiaspreuss
 
Protractor framework – how to make stable e2e tests for Angular applications
Ludmila Nesvitiy
 
Quickly Testing Qt Desktop Applications
Clare Macrae
 
Unit Testing on Android - Droidcon Berlin 2015
Buşra Deniz, CSM
 
Unit-testing and E2E testing in JS
Michael Haberman
 
Test all the things! Automated testing with Drupal 8
Sam Becker
 
Unit Testing in iOS
Long Weekend LLC
 
軟體測試是在測試什麼?
Yao Nien Chung
 

Similar to Functional Testing made easy with SWTBot for Developers and Testers (20)

PPTX
Java script unit testing
Mats Bryntse
 
PPTX
Solving the Automation Puzzle - how to select the right automation framework ...
Ori Bendet
 
PPTX
When & How to Successfully use Test Automation for Mobile Applications
TechnologyAssociationOregon
 
PDF
Test automation - Building effective solutions
Artem Nagornyi
 
PPTX
What's so great about web driver?
mwinteringham
 
ODP
Alexandre Iline Rit 2010 Java Fxui
rit2010
 
PPTX
Testing for Android: When, Where, and How to Successfully Use Test Automation
Trent Peterson
 
PDF
Selenide
DataArt
 
PPTX
The Right Tool for the Right Project
Ori Bendet
 
PDF
Introduzione a junit + integrazione con archibus
Davide Fella
 
PPTX
Spot the difference - automating visual regression testing
Viv Richards
 
PPT
Test automationslides
UMA MAHESWARI
 
PDF
UI Testing with Spec
ESUG
 
PDF
A Modern Dive into QA Automation and Beyond
Pratik Patel
 
PDF
Experitest & Tech Mahindra Co-Webinar
Experitest
 
ODP
Alexandre.iline rit 2010 java_fxui_extra
rit2010
 
PDF
Hands-on Experience Model based testing with spec explorer
Rachid Kherrazi
 
PPTX
Test automation proposal
Mihai-Cristian Fratila
 
PPTX
Flextestingautomation 111116190906-phpapp02
Gokuldas Pillai
 
PPTX
Maturity of Mobile Test Automation: Approaches and Future Trends- Impetus Web...
Impetus Technologies
 
Java script unit testing
Mats Bryntse
 
Solving the Automation Puzzle - how to select the right automation framework ...
Ori Bendet
 
When & How to Successfully use Test Automation for Mobile Applications
TechnologyAssociationOregon
 
Test automation - Building effective solutions
Artem Nagornyi
 
What's so great about web driver?
mwinteringham
 
Alexandre Iline Rit 2010 Java Fxui
rit2010
 
Testing for Android: When, Where, and How to Successfully Use Test Automation
Trent Peterson
 
Selenide
DataArt
 
The Right Tool for the Right Project
Ori Bendet
 
Introduzione a junit + integrazione con archibus
Davide Fella
 
Spot the difference - automating visual regression testing
Viv Richards
 
Test automationslides
UMA MAHESWARI
 
UI Testing with Spec
ESUG
 
A Modern Dive into QA Automation and Beyond
Pratik Patel
 
Experitest & Tech Mahindra Co-Webinar
Experitest
 
Alexandre.iline rit 2010 java_fxui_extra
rit2010
 
Hands-on Experience Model based testing with spec explorer
Rachid Kherrazi
 
Test automation proposal
Mihai-Cristian Fratila
 
Flextestingautomation 111116190906-phpapp02
Gokuldas Pillai
 
Maturity of Mobile Test Automation: Approaches and Future Trends- Impetus Web...
Impetus Technologies
 
Ad

More from Aurélien Pupier (14)

PDF
How to contribute textual tooling for apache camel in several id es
Aurélien Pupier
 
PDF
Feedback from an eclipse plugin developer to provide support to large set of ...
Aurélien Pupier
 
PDF
Adopting language server for apache camel feedback from a java/Eclipse plugi...
Aurélien Pupier
 
PDF
Why and how to leverage apache camel integration framework in your io t archi...
Aurélien Pupier
 
PDF
Master your integration projects on premise and in the cloud with fuse tooling
Aurélien Pupier
 
ODP
Classic middleware integration for your IoT Gateways integration
Aurélien Pupier
 
PDF
Fast unit tests for Eclipse Plugins
Aurélien Pupier
 
PDF
Committing IDE meta files: misconceptions, misunderstandings, and solutions.
Aurélien Pupier
 
PPTX
How to contribute to Eclipse
Aurélien Pupier
 
PDF
Time to build and test results 3x faster - how we did it
Aurélien Pupier
 
PDF
Take advantage of memory analyzer tool inside your continuous integration
Aurélien Pupier
 
PDF
Tools and Methodologies to leverage GMF power (EclipseDay Delft 2012)
Aurélien Pupier
 
PDF
What's new GMF for Juno?
Aurélien Pupier
 
PDF
What's hot Juno?
Aurélien Pupier
 
How to contribute textual tooling for apache camel in several id es
Aurélien Pupier
 
Feedback from an eclipse plugin developer to provide support to large set of ...
Aurélien Pupier
 
Adopting language server for apache camel feedback from a java/Eclipse plugi...
Aurélien Pupier
 
Why and how to leverage apache camel integration framework in your io t archi...
Aurélien Pupier
 
Master your integration projects on premise and in the cloud with fuse tooling
Aurélien Pupier
 
Classic middleware integration for your IoT Gateways integration
Aurélien Pupier
 
Fast unit tests for Eclipse Plugins
Aurélien Pupier
 
Committing IDE meta files: misconceptions, misunderstandings, and solutions.
Aurélien Pupier
 
How to contribute to Eclipse
Aurélien Pupier
 
Time to build and test results 3x faster - how we did it
Aurélien Pupier
 
Take advantage of memory analyzer tool inside your continuous integration
Aurélien Pupier
 
Tools and Methodologies to leverage GMF power (EclipseDay Delft 2012)
Aurélien Pupier
 
What's new GMF for Juno?
Aurélien Pupier
 
What's hot Juno?
Aurélien Pupier
 
Ad

Recently uploaded (20)

PDF
Beyond Binaries: Understanding Diversity and Allyship in a Global Workplace -...
Imma Valls Bernaus
 
PPTX
The Role of a PHP Development Company in Modern Web Development
SEO Company for School in Delhi NCR
 
PDF
iTop VPN With Crack Lifetime Activation Key-CODE
utfefguu
 
PPTX
Writing Better Code - Helping Developers make Decisions.pptx
Lorraine Steyn
 
PDF
HiHelloHR – Simplify HR Operations for Modern Workplaces
HiHelloHR
 
PDF
MiniTool Partition Wizard 12.8 Crack License Key LATEST
hashhshs786
 
PDF
Build It, Buy It, or Already Got It? Make Smarter Martech Decisions
bbedford2
 
PDF
Unlock Efficiency with Insurance Policy Administration Systems
Insurance Tech Services
 
PDF
유니티에서 Burst Compiler+ThreadedJobs+SIMD 적용사례
Seongdae Kim
 
PPT
MergeSortfbsjbjsfk sdfik k
RafishaikIT02044
 
PDF
Alexander Marshalov - How to use AI Assistants with your Monitoring system Q2...
VictoriaMetrics
 
PPTX
Platform for Enterprise Solution - Java EE5
abhishekoza1981
 
PDF
Odoo CRM vs Zoho CRM: Honest Comparison 2025
Odiware Technologies Private Limited
 
PDF
Digger Solo: Semantic search and maps for your local files
seanpedersen96
 
PPTX
Tally_Basic_Operations_Presentation.pptx
AditiBansal54083
 
PPTX
Equipment Management Software BIS Safety UK.pptx
BIS Safety Software
 
PPTX
A Complete Guide to Salesforce SMS Integrations Build Scalable Messaging With...
360 SMS APP
 
PDF
Linux Certificate of Completion - LabEx Certificate
VICTOR MAESTRE RAMIREZ
 
PDF
GetOnCRM Speeds Up Agentforce 3 Deployment for Enterprise AI Wins.pdf
GetOnCRM Solutions
 
PPTX
Feb 2021 Cohesity first pitch presentation.pptx
enginsayin1
 
Beyond Binaries: Understanding Diversity and Allyship in a Global Workplace -...
Imma Valls Bernaus
 
The Role of a PHP Development Company in Modern Web Development
SEO Company for School in Delhi NCR
 
iTop VPN With Crack Lifetime Activation Key-CODE
utfefguu
 
Writing Better Code - Helping Developers make Decisions.pptx
Lorraine Steyn
 
HiHelloHR – Simplify HR Operations for Modern Workplaces
HiHelloHR
 
MiniTool Partition Wizard 12.8 Crack License Key LATEST
hashhshs786
 
Build It, Buy It, or Already Got It? Make Smarter Martech Decisions
bbedford2
 
Unlock Efficiency with Insurance Policy Administration Systems
Insurance Tech Services
 
유니티에서 Burst Compiler+ThreadedJobs+SIMD 적용사례
Seongdae Kim
 
MergeSortfbsjbjsfk sdfik k
RafishaikIT02044
 
Alexander Marshalov - How to use AI Assistants with your Monitoring system Q2...
VictoriaMetrics
 
Platform for Enterprise Solution - Java EE5
abhishekoza1981
 
Odoo CRM vs Zoho CRM: Honest Comparison 2025
Odiware Technologies Private Limited
 
Digger Solo: Semantic search and maps for your local files
seanpedersen96
 
Tally_Basic_Operations_Presentation.pptx
AditiBansal54083
 
Equipment Management Software BIS Safety UK.pptx
BIS Safety Software
 
A Complete Guide to Salesforce SMS Integrations Build Scalable Messaging With...
360 SMS APP
 
Linux Certificate of Completion - LabEx Certificate
VICTOR MAESTRE RAMIREZ
 
GetOnCRM Speeds Up Agentforce 3 Deployment for Enterprise AI Wins.pdf
GetOnCRM Solutions
 
Feb 2021 Cohesity first pitch presentation.pptx
enginsayin1
 

Functional Testing made easy with SWTBot for Developers and Testers

  • 1. Functional Testing made easy with SWTBot for Developers and Testers Aurelien Pupier - @apupier Studio Development Leader © 2015 Bonitasoft 2
  • 2. What is SWTBot? Java Framework for SWT automated UI tests © 2015 Bonitasoft 3 And also…
  • 3. SWTBot – General workings • Encapsulate UI components • Send SWT Events to simulate User interaction 4© 2015 Bonitasoft
  • 4. SWTBot – Sample 5© 2015 Bonitasoft bot.textWithLabel(“Name *”).setText(“userName”); bot.comboBox().select(“Text”); bot.textWithLabel(“Default value”).setText(“john”); bot.button(“Finish”).click();
  • 5. SWTBot – Advantages • Easy to understand for developers • Easy to write first shot • … Even a recorder • Access to Java API for assertions • Test code coverage 6© 2015 Bonitasoft
  • 6. SWTBot limitations (1/5) • Underlying components knowledge – Widget types – Eclipse wording 7© 2015 Bonitasoft Table or List? Combo or CCombo?
  • 7. SWTBot limitations (2/5) • Same widget at different place – SWTBotConstants.SWTBOT_WIDGET_ID_KEY – production code modified 8© 2015 Bonitasoft
  • 8. SWTBot limitations (3/5) • UI Thread synchronization  Robustness hard: – Correct implementation of waitUntil required – (even if Conditions provided) 9© 2015 Bonitasoft
  • 9. SWTBot limitations (4/5) • Java code not accessible for Java/Eclipse beginners – For all previously mentioned reasons 10© 2015 Bonitasoft
  • 10. SWTBot limitations (5/5) • Maintenance of tests: – Requires to be close to production code • Message updated (to fix a typo) • UI updated (from Combo to CCombo…) 11© 2015 Bonitasoft
  • 11. SWTBot conclusion SWTBot is an handy test tool for developers 12© 2015 Bonitasoft
  • 12. What about testers? • How to let testers writing Functional tests? – Do not care of implementation details 13© 2015 Bonitasoft
  • 13. Application Oriented API ‘Page Object Pattern’ 14© 2015 Bonitasoft
  • 14. Application Oriented API 15© 2015 Bonitasoft
  • 15. Page Pattern sample (1/2) 16© 2015 Bonitasoft new BotDataDialog(). .setName(“userName”) .setType(“Text”) .setDefaultValue(“john”) .finish(); bot.waitUntil(Conditions.shellIsActive(Messages.newVariable)); SWTBotShell shell = bot.activeShell(); bot.textWithLabel(Messages.name_mandatory).setText(“userName”); bot.comboBox().select(“Text”); bot.textWithLabel(Messages.defaultValue).setText(“john”); bot.button(IDialogConstants.FINISH_LABEL).click(); bot.waitUntil(Conditions.shellCloses(shell));
  • 16. Page Pattern sample (2/2) 17© 2015 Bonitasoft new BotDataDialog(). .setName(“userName”) .setType(“Text”) .setDefaultValue(“john”) .finish(); bot.waitUntil(Conditions.shellIsActive(Messages.newVariable)); SWTBotShell shell = bot.activeShell(); bot.textWithLabel(Messages.name_mandatory).setText(“userName”); bot.comboBox().select(“Text”); bot.textWithLabel(Messages.defaultValue).setText(“john”); bot.button(IDialogConstants.FINISH_LABEL).click(); bot.waitUntil(Conditions.shellCloses(shell));
  • 17. What decided us? • Successful implementation with Selenium and Chinese QA team • Code mess – Big static utility classes… – Sometimes right utility class hard to find • Robustness issue – CI infra updated  ~10% of UI tests unstable • Half-day for one test • Invite QA testers to join the party • Same tooling Development/QA 18© 2015 Bonitasoft
  • 18. Observed benefits Eases writing… … and maintaining Functional Tests … for Testers AND Developers – New UI test: Half-day  1 hour – More factorized code – Robustness 19© 2015 Bonitasoft
  • 19. Feedback on implementation • Setup time ~3 weeks • On the fly 20© 2015 Bonitasoft
  • 21. What’s next? • BDD – Get stake holders and user advocates to join the party – Talk about using Cucumber with SWTBot • RedDeer – Reuse the Eclipse components 22© 2015 Bonitasoft
  • 22. Visit us online bonitasoft.com Join our community Bonitasoft.org Download Bonitasoft.com/downloads Follow us on twitter @bonitasoft “Page” your App! @apupier © 2015 Bonitasoft 23