SlideShare a Scribd company logo
RELOADED
SELENIUM
TESTING
PATTERNS
JAVAONE 2017
CON3276
SAN FRANCISCO - 4 OCTOBER 2017
JORGE HIDALGO
VICENTE GONZÁLEZ
ACCENTURE DELIVERY CENTER IN SPAIN
ACCENTURE GLOBAL JAVA CAPABILITY
SEQUELS ARE NEVER ANY GOOD… REALLY?
Copyright © 2017 Accenture All rights reserved.
PRESENTER INTRODUCTIONS
Jorge Hidalgo
@_deors
deors
Senior Technology Architect
Global Java Community Lead
Accenture Spain
Father of two children, husband, Irish flute &
whistle player, video gamer, master chief
apprentice, sci-fi ‘junkie’, Star Wars fan,
eternal Lego journeyman, gadget lover and
in love with Raspberry Pi computers
Vicente González
@viarellano
viarellano
Technology Architect
Global Java Community Champion
Accenture Spain
52 month experience husband, proud father
of 3 years old princess Regina, senior beach
user, cooking lover, associate paddle player,
master Feria de Abril enthusiast, Sevilla FC fan
and Pearl Jam ninja evangelizer
REVISITING SELENIUM BEST PRACTICES AND PATTERNS
Copyright 2017 Accenture. All rights reserved. 3
SELENIUM RELOADED
Tips for Setting up a Selenium Grid
XPath and Testability
Effective use of APIs and Interfaces
Continuous Testing for Microservices
#TIP 1:
USING JSON FOR
CONFIGURATION
Copyright 2017 Accenture. All rights reserved. 4
#TIP 1: USING JSON FOR CONFIGURATION
Copyright 2017 Accenture. All rights reserved. 5
#TIP 2:
MANAGING NODES
WITH
VISGRID
Copyright 2017 Accenture. All rights reserved. 6
#TIP 2: MANAGING NODES WITH VISGRID
Copyright 2017 Accenture. All rights reserved. 7
VISGRID
DESKTOP JAVA APPLICATION THAT HELPS MANAGING HUBS AND
NODES
• Download from https://codoid.com/wp-content/uploads/2017/09/Visgrid-<version>.zip
• Decompress Visgrid-<version>.zip
• java –jar visgrid-1.14.jar
VisGrid is provided by Codoid (https://codoid.com/) under Apache License
#TIP 3:
CREATING AN
EPHEMERAL GRID
Copyright 2017 Accenture. All rights reserved. 8
#TIP 3: CREATING AN EPHEMERAL GRID
Copyright 2017 Accenture. All rights reserved. 9
YOU CAN CONFIGURE AND LAUNCH NODES FROM YOUR
CODE
• Add the Selenium Server dependency to your POM
#TIP 3: CREATING AN EPHEMERAL GRID
Copyright 2017 Accenture. All rights reserved. 10
Use the GridLauncher to create server instances with different roles
#TIP 4:
MANAGING DRIVERS
BINARIES
WEBDRIVERMANAGER
Copyright 2017 Accenture. All rights reserved. 11
#TIP 4: MANAGING DRIVERS BINARIES
WEBDRIVERMANAGER
Copyright 2017 Accenture. All rights reserved. 12
WebDriverManager
An OpenSource Project that helps one of the most commons
nightmares while using Selenium:
Managing the webdriver binaries.
https://github.com/bonigarcia/webdrivermanager
#TIP 4: MANAGING DRIVERS WITH
WEBDRIVERMANAGER
Copyright 2017 Accenture. All rights reserved. 13
Add the dependency
Use the DriverManager
#TIP 4: MANAGING DRIVERS WITH
WEBDRIVERMANAGER
Copyright 2017 Accenture. All rights reserved. 14
Fully configurable using the API
Or parameters
#TIP 5:
XPATH IS NOT
UNDER YOUR
CONTROL
Copyright 2017 Accenture. All rights reserved. 15
XPath usage in Selenium depends on:
Native capabilities for XPath of each browser
If not available, Selenium provides its own implementation
#TIP5: XPATH IS NOT UNDER YOUR CONTROL
An example from the Selenium documentation
#TIP5: XPATH IS NOT UNDER YOUR CONTROL
COROLLARY:
NEVER, NEVER
USE XPATH
Using XPath for
interacting with
your web is not
a PREDICTABLE
nor
REPEATABLE
approach.
#TIP 6:
ALTERNATIVES:
PROVIDE PREDICTABLE
ID TO YOUR WEB
ELEMENTS
Copyright 2017 Accenture. All rights reserved. 19
Instead of investing a lot in creating highly
complicated ways to interact with the elements in
your application, consider change the application
instead
- Overriding ID of your web elements
- Creating anchor elements that helps on
accessing your elements
#TIP6: ALTERNATIVES: PROVIDE
PREDICTABLE ID TO YOUR WEB ELEMENTS
COROLLARY:
THINK ON
TESTABILITY
One of the
drivers when
you define your
web framework
should be the
ability to test
the application
#TIP 7:
USING API
EFFECTIVELY:
THE ISELECT
INTERFACE
Copyright 2017 Accenture. All rights reserved. 22
The ISelect Interface provide methods to interact
with elements of type Select.
The Select implementation provides methods for:
• Select (by Index, by Value, by Text)
• Deselect (All, by Index, by Value, by Text)
Works with MultiSelect
#TIP7: USING API EFFECTIVELY: THE ISELECT
INTERFACE
#TIP 8:
THE ACTION
BUILDER CAN
ALSO HELPS
Copyright 2017 Accenture. All rights reserved. 24
We are using Selenium to emulate human
interaction with the application under test
The Action Interface Builder can be useful when
try to explicitly guide the interaction through your
web page
#TIP8: THE ACTION BUILDER CAN ALSO
HELPS
#TIP 9:
CONTINUOUS
TESTING FOR
MICROSERVICES
Copyright 2017 Accenture. All rights reserved. 26
Jenkins as Orchestrator
CONTINUOUS DELIVERY PIPELINES
Copyright © 2017 Accenture. All rights reserved. 27
Test scope is limited
to one service/app
Test scope is
end-to-end
Jenkins as Orchestrator
CONTINUOUS DELIVERY TRIGGERS
Copyright © 2017 Accenture. All rights reserved. 28
Trigger on code/config/test change
Tests are in the same code repo
Trigger after any component
is promoted and deployed
Trigger on end-to-end test change
End-to-end tests (and test data)
are in separate code repo
May reuse tests from components
corollary:
consider it as an
application
When you are
using Selenium
you are creating
an application
to test your
application
creditsRepositories:
https://github.com/viarellano/deors.demos.petclinic
https://github.com/deors/deors.demos.petclinic
Presentation from JavaOne 2016
https://es.slideshare.net/deors/javaone-2016-con3080-testing-
java-web-applications-with-selenium-a-cookbook

More Related Content

What's hot (20)

PDF
A Journey to Improve Infrastructure Compliance With InSpec
Cliffano Subagio
 
PPTX
Cloud Collaboration with Eclipse Che
Martin (高馬丁) Skarsaune
 
PDF
.Net Hijacking to Defend PowerShell BSidesSF2017
Amanda Rousseau
 
PDF
From zero to hero with React Native!
Commit University
 
PPTX
PDE builds or Maven
Eclipse Day India
 
PDF
Building Rich Applications with Appcelerator
Matt Raible
 
PDF
Reverse engineering and instrumentation of android apps
Gaurav Lochan
 
PPTX
Gabriele Provinciali/Gabriele Folchi/Luca Postacchini - Sviluppo con piattafo...
Codemotion
 
PPTX
Iterative Development with Swagger on the JDK
Swagger API
 
PDF
Developing modern java web applications with java ee 7 and angular js
Shekhar Gulati
 
PDF
Internal Android Library Management (DroidCon SF 2016, Droidcon Italy 2016)
Kelly Shuster
 
PDF
Formacion en movilidad: Conceptos de desarrollo en iOS (I)
Mobivery
 
PDF
Android talks #08 dagger2
Infinum
 
PDF
Lean Engineering. Applying Lean Principles to Building Experiences
Bill Scott
 
PDF
Gwt and JSR 269's Pluggable Annotation Processing API
Arnaud Tournier
 
PPTX
Rancher master class globalized edge workloads with k3s
Joseph Marhee
 
PDF
.NET Online TechTalk “Azure Cloud for DEV”
GlobalLogic Ukraine
 
PDF
Using Go in DevOps
Eficode
 
PDF
Working effectively with OpenShift
Shekhar Gulati
 
PPTX
Writer APIs in Java faster with Swagger Inflector
Tony Tam
 
A Journey to Improve Infrastructure Compliance With InSpec
Cliffano Subagio
 
Cloud Collaboration with Eclipse Che
Martin (高馬丁) Skarsaune
 
.Net Hijacking to Defend PowerShell BSidesSF2017
Amanda Rousseau
 
From zero to hero with React Native!
Commit University
 
PDE builds or Maven
Eclipse Day India
 
Building Rich Applications with Appcelerator
Matt Raible
 
Reverse engineering and instrumentation of android apps
Gaurav Lochan
 
Gabriele Provinciali/Gabriele Folchi/Luca Postacchini - Sviluppo con piattafo...
Codemotion
 
Iterative Development with Swagger on the JDK
Swagger API
 
Developing modern java web applications with java ee 7 and angular js
Shekhar Gulati
 
Internal Android Library Management (DroidCon SF 2016, Droidcon Italy 2016)
Kelly Shuster
 
Formacion en movilidad: Conceptos de desarrollo en iOS (I)
Mobivery
 
Android talks #08 dagger2
Infinum
 
Lean Engineering. Applying Lean Principles to Building Experiences
Bill Scott
 
Gwt and JSR 269's Pluggable Annotation Processing API
Arnaud Tournier
 
Rancher master class globalized edge workloads with k3s
Joseph Marhee
 
.NET Online TechTalk “Azure Cloud for DEV”
GlobalLogic Ukraine
 
Using Go in DevOps
Eficode
 
Working effectively with OpenShift
Shekhar Gulati
 
Writer APIs in Java faster with Swagger Inflector
Tony Tam
 

Similar to JavaOne 2017 CON3276 - Selenium Testing Patterns Reloaded (20)

PDF
5 Ways to Get Top Mobile App Developer Talent for Your Open APIs
CA API Management
 
PDF
Dockerizing An Angular Application Using Git, Jenkins & Docker! | DevOps Tuto...
Edureka!
 
PPTX
JavaOne 2016 - CON3080 - Testing Java Web Applications with Selenium: A Cookbook
Jorge Hidalgo
 
PPTX
Shifting Left: The Top 5 Reasons to Test APIs and Components Early
Neotys
 
PDF
4th pdf off page seo.pdf
excellenceacademy420
 
PPTX
Api-First service design
Stefaan Ponnet
 
PPTX
More tips and tricks for running containers like a pro - Rancher Online MEetu...
Shannon Williams
 
PDF
CWIN17 New-York / Drive continuous delivery with continous testing
Capgemini
 
PDF
Database as code in Devops - DBを10分間で1000個構築するDB仮想化テクノロジーとは?(Adam)
Insight Technology, Inc.
 
PDF
Write less, achieve meh - HTML5DevConf 2014
Christian Heilmann
 
PDF
Web Application Development – Top 8 Frameworks in 2025.pdf
Delimp Technology
 
PPTX
API Services: Building State-of-the-Art APIs
Apigee | Google Cloud
 
PDF
Your Ultimate Toolkit: Top Cross-Platform App Development Frameworks for 2024
Inwizards Software Technology
 
PDF
5 Keys to API Design - API Days Paris 2013
Daniel Feist
 
PPTX
DevGeekWeek 2017 Inflectra Meetup in Herzliya Presentation
Adam Sandman
 
PDF
React Native App Development.
Techugo
 
PDF
Why react native has become the winning choice for cross platform development
Shelly Megan
 
PDF
Jakarta Tech Talk: How to develop your first cloud-native Application with Java
Niklas Heidloff
 
PPTX
Top 10 React Development Tools to Choose in 2023.pptx
75waytechnologies
 
PDF
7 Features Of React Native
IndumathySK
 
5 Ways to Get Top Mobile App Developer Talent for Your Open APIs
CA API Management
 
Dockerizing An Angular Application Using Git, Jenkins & Docker! | DevOps Tuto...
Edureka!
 
JavaOne 2016 - CON3080 - Testing Java Web Applications with Selenium: A Cookbook
Jorge Hidalgo
 
Shifting Left: The Top 5 Reasons to Test APIs and Components Early
Neotys
 
4th pdf off page seo.pdf
excellenceacademy420
 
Api-First service design
Stefaan Ponnet
 
More tips and tricks for running containers like a pro - Rancher Online MEetu...
Shannon Williams
 
CWIN17 New-York / Drive continuous delivery with continous testing
Capgemini
 
Database as code in Devops - DBを10分間で1000個構築するDB仮想化テクノロジーとは?(Adam)
Insight Technology, Inc.
 
Write less, achieve meh - HTML5DevConf 2014
Christian Heilmann
 
Web Application Development – Top 8 Frameworks in 2025.pdf
Delimp Technology
 
API Services: Building State-of-the-Art APIs
Apigee | Google Cloud
 
Your Ultimate Toolkit: Top Cross-Platform App Development Frameworks for 2024
Inwizards Software Technology
 
5 Keys to API Design - API Days Paris 2013
Daniel Feist
 
DevGeekWeek 2017 Inflectra Meetup in Herzliya Presentation
Adam Sandman
 
React Native App Development.
Techugo
 
Why react native has become the winning choice for cross platform development
Shelly Megan
 
Jakarta Tech Talk: How to develop your first cloud-native Application with Java
Niklas Heidloff
 
Top 10 React Development Tools to Choose in 2023.pptx
75waytechnologies
 
7 Features Of React Native
IndumathySK
 
Ad

More from Jorge Hidalgo (20)

PDF
GraalVM - MadridJUG 2019-10-22
Jorge Hidalgo
 
PDF
GraalVM - OpenSlava 2019-10-18
Jorge Hidalgo
 
PDF
Architecture 2020 - eComputing 2019-07-01
Jorge Hidalgo
 
PDF
GraalVM - JBCNConf 2019-05-28
Jorge Hidalgo
 
PDF
GraalVM - MálagaJUG 2018-11-29
Jorge Hidalgo
 
PDF
Multilanguage Pipelines with Jenkins, Docker and Kubernetes (Commit Conf 2018)
Jorge Hidalgo
 
PDF
Multilanguage Pipelines with Jenkins, Docker and Kubernetes (Oracle Code One ...
Jorge Hidalgo
 
PDF
Multilanguage pipelines with Jenkins, Docker and Kubernetes (DevOpsDays Riga ...
Jorge Hidalgo
 
PPTX
DevOps Te Cambia la Vida - eComputing 2018-07-03
Jorge Hidalgo
 
PPTX
Open Source Power Tools - Opensouthcode 2018-06-02
Jorge Hidalgo
 
PDF
All Your Faces Belong to Us - Opensouthcode 2017-05-06
Jorge Hidalgo
 
PDF
Por qué DevOps, por qué ahora @ CHAPI 2017
Jorge Hidalgo
 
PDF
Accenture Liquid Architectures (for Master EMSE UPM-FI - April 2017)
Jorge Hidalgo
 
PPTX
La JVM y el Internet de las Cosas @ MálagaJUG 2016-11-17
Jorge Hidalgo
 
PPTX
OpenSlava 2016 - Lightweight Java Architectures
Jorge Hidalgo
 
PPTX
OpenSouthCode 2016 - Accenture DevOps Platform 2016-05-07
Jorge Hidalgo
 
PPTX
JavaOne 2015 - CON6489 - Smart Open Spaces Powered by Low Cost Computers
Jorge Hidalgo
 
PPTX
JavaOne 2014 - CON2013 - Code Generation in the Java Compiler: Annotation Pro...
Jorge Hidalgo
 
PPTX
Next-gen IDE v2 - OpenSlava 2013-10-11
Jorge Hidalgo
 
PPTX
The Usual Suspects - Red Hat Developer Day 2012-11-01
Jorge Hidalgo
 
GraalVM - MadridJUG 2019-10-22
Jorge Hidalgo
 
GraalVM - OpenSlava 2019-10-18
Jorge Hidalgo
 
Architecture 2020 - eComputing 2019-07-01
Jorge Hidalgo
 
GraalVM - JBCNConf 2019-05-28
Jorge Hidalgo
 
GraalVM - MálagaJUG 2018-11-29
Jorge Hidalgo
 
Multilanguage Pipelines with Jenkins, Docker and Kubernetes (Commit Conf 2018)
Jorge Hidalgo
 
Multilanguage Pipelines with Jenkins, Docker and Kubernetes (Oracle Code One ...
Jorge Hidalgo
 
Multilanguage pipelines with Jenkins, Docker and Kubernetes (DevOpsDays Riga ...
Jorge Hidalgo
 
DevOps Te Cambia la Vida - eComputing 2018-07-03
Jorge Hidalgo
 
Open Source Power Tools - Opensouthcode 2018-06-02
Jorge Hidalgo
 
All Your Faces Belong to Us - Opensouthcode 2017-05-06
Jorge Hidalgo
 
Por qué DevOps, por qué ahora @ CHAPI 2017
Jorge Hidalgo
 
Accenture Liquid Architectures (for Master EMSE UPM-FI - April 2017)
Jorge Hidalgo
 
La JVM y el Internet de las Cosas @ MálagaJUG 2016-11-17
Jorge Hidalgo
 
OpenSlava 2016 - Lightweight Java Architectures
Jorge Hidalgo
 
OpenSouthCode 2016 - Accenture DevOps Platform 2016-05-07
Jorge Hidalgo
 
JavaOne 2015 - CON6489 - Smart Open Spaces Powered by Low Cost Computers
Jorge Hidalgo
 
JavaOne 2014 - CON2013 - Code Generation in the Java Compiler: Annotation Pro...
Jorge Hidalgo
 
Next-gen IDE v2 - OpenSlava 2013-10-11
Jorge Hidalgo
 
The Usual Suspects - Red Hat Developer Day 2012-11-01
Jorge Hidalgo
 
Ad

Recently uploaded (20)

PDF
4K Video Downloader Plus Pro Crack for MacOS New Download 2025
bashirkhan333g
 
PPTX
Agentic Automation Journey Session 1/5: Context Grounding and Autopilot for E...
klpathrudu
 
PPTX
Change Common Properties in IBM SPSS Statistics Version 31.pptx
Version 1 Analytics
 
PDF
Empower Your Tech Vision- Why Businesses Prefer to Hire Remote Developers fro...
logixshapers59
 
PPTX
Foundations of Marketo Engage - Powering Campaigns with Marketo Personalization
bbedford2
 
PPTX
Hardware(Central Processing Unit ) CU and ALU
RizwanaKalsoom2
 
PPTX
Milwaukee Marketo User Group - Summer Road Trip: Mapping and Personalizing Yo...
bbedford2
 
PPTX
Help for Correlations in IBM SPSS Statistics.pptx
Version 1 Analytics
 
PDF
MiniTool Partition Wizard Free Crack + Full Free Download 2025
bashirkhan333g
 
PPTX
ChiSquare Procedure in IBM SPSS Statistics Version 31.pptx
Version 1 Analytics
 
PDF
Open Chain Q2 Steering Committee Meeting - 2025-06-25
Shane Coughlan
 
PDF
AI + DevOps = Smart Automation with devseccops.ai.pdf
Devseccops.ai
 
PDF
SAP Firmaya İade ABAB Kodları - ABAB ile yazılmıl hazır kod örneği
Salih Küçük
 
PDF
Alexander Marshalov - How to use AI Assistants with your Monitoring system Q2...
VictoriaMetrics
 
PDF
HiHelloHR – Simplify HR Operations for Modern Workplaces
HiHelloHR
 
PPTX
Finding Your License Details in IBM SPSS Statistics Version 31.pptx
Version 1 Analytics
 
PDF
[Solution] Why Choose the VeryPDF DRM Protector Custom-Built Solution for You...
Lingwen1998
 
PDF
유니티에서 Burst Compiler+ThreadedJobs+SIMD 적용사례
Seongdae Kim
 
PPTX
Empowering Asian Contributions: The Rise of Regional User Groups in Open Sour...
Shane Coughlan
 
PDF
TheFutureIsDynamic-BoxLang witch Luis Majano.pdf
Ortus Solutions, Corp
 
4K Video Downloader Plus Pro Crack for MacOS New Download 2025
bashirkhan333g
 
Agentic Automation Journey Session 1/5: Context Grounding and Autopilot for E...
klpathrudu
 
Change Common Properties in IBM SPSS Statistics Version 31.pptx
Version 1 Analytics
 
Empower Your Tech Vision- Why Businesses Prefer to Hire Remote Developers fro...
logixshapers59
 
Foundations of Marketo Engage - Powering Campaigns with Marketo Personalization
bbedford2
 
Hardware(Central Processing Unit ) CU and ALU
RizwanaKalsoom2
 
Milwaukee Marketo User Group - Summer Road Trip: Mapping and Personalizing Yo...
bbedford2
 
Help for Correlations in IBM SPSS Statistics.pptx
Version 1 Analytics
 
MiniTool Partition Wizard Free Crack + Full Free Download 2025
bashirkhan333g
 
ChiSquare Procedure in IBM SPSS Statistics Version 31.pptx
Version 1 Analytics
 
Open Chain Q2 Steering Committee Meeting - 2025-06-25
Shane Coughlan
 
AI + DevOps = Smart Automation with devseccops.ai.pdf
Devseccops.ai
 
SAP Firmaya İade ABAB Kodları - ABAB ile yazılmıl hazır kod örneği
Salih Küçük
 
Alexander Marshalov - How to use AI Assistants with your Monitoring system Q2...
VictoriaMetrics
 
HiHelloHR – Simplify HR Operations for Modern Workplaces
HiHelloHR
 
Finding Your License Details in IBM SPSS Statistics Version 31.pptx
Version 1 Analytics
 
[Solution] Why Choose the VeryPDF DRM Protector Custom-Built Solution for You...
Lingwen1998
 
유니티에서 Burst Compiler+ThreadedJobs+SIMD 적용사례
Seongdae Kim
 
Empowering Asian Contributions: The Rise of Regional User Groups in Open Sour...
Shane Coughlan
 
TheFutureIsDynamic-BoxLang witch Luis Majano.pdf
Ortus Solutions, Corp
 

JavaOne 2017 CON3276 - Selenium Testing Patterns Reloaded

  • 1. RELOADED SELENIUM TESTING PATTERNS JAVAONE 2017 CON3276 SAN FRANCISCO - 4 OCTOBER 2017 JORGE HIDALGO VICENTE GONZÁLEZ ACCENTURE DELIVERY CENTER IN SPAIN ACCENTURE GLOBAL JAVA CAPABILITY SEQUELS ARE NEVER ANY GOOD… REALLY?
  • 2. Copyright © 2017 Accenture All rights reserved. PRESENTER INTRODUCTIONS Jorge Hidalgo @_deors deors Senior Technology Architect Global Java Community Lead Accenture Spain Father of two children, husband, Irish flute & whistle player, video gamer, master chief apprentice, sci-fi ‘junkie’, Star Wars fan, eternal Lego journeyman, gadget lover and in love with Raspberry Pi computers Vicente González @viarellano viarellano Technology Architect Global Java Community Champion Accenture Spain 52 month experience husband, proud father of 3 years old princess Regina, senior beach user, cooking lover, associate paddle player, master Feria de Abril enthusiast, Sevilla FC fan and Pearl Jam ninja evangelizer
  • 3. REVISITING SELENIUM BEST PRACTICES AND PATTERNS Copyright 2017 Accenture. All rights reserved. 3 SELENIUM RELOADED Tips for Setting up a Selenium Grid XPath and Testability Effective use of APIs and Interfaces Continuous Testing for Microservices
  • 4. #TIP 1: USING JSON FOR CONFIGURATION Copyright 2017 Accenture. All rights reserved. 4
  • 5. #TIP 1: USING JSON FOR CONFIGURATION Copyright 2017 Accenture. All rights reserved. 5
  • 6. #TIP 2: MANAGING NODES WITH VISGRID Copyright 2017 Accenture. All rights reserved. 6
  • 7. #TIP 2: MANAGING NODES WITH VISGRID Copyright 2017 Accenture. All rights reserved. 7 VISGRID DESKTOP JAVA APPLICATION THAT HELPS MANAGING HUBS AND NODES • Download from https://codoid.com/wp-content/uploads/2017/09/Visgrid-<version>.zip • Decompress Visgrid-<version>.zip • java –jar visgrid-1.14.jar VisGrid is provided by Codoid (https://codoid.com/) under Apache License
  • 8. #TIP 3: CREATING AN EPHEMERAL GRID Copyright 2017 Accenture. All rights reserved. 8
  • 9. #TIP 3: CREATING AN EPHEMERAL GRID Copyright 2017 Accenture. All rights reserved. 9 YOU CAN CONFIGURE AND LAUNCH NODES FROM YOUR CODE • Add the Selenium Server dependency to your POM
  • 10. #TIP 3: CREATING AN EPHEMERAL GRID Copyright 2017 Accenture. All rights reserved. 10 Use the GridLauncher to create server instances with different roles
  • 11. #TIP 4: MANAGING DRIVERS BINARIES WEBDRIVERMANAGER Copyright 2017 Accenture. All rights reserved. 11
  • 12. #TIP 4: MANAGING DRIVERS BINARIES WEBDRIVERMANAGER Copyright 2017 Accenture. All rights reserved. 12 WebDriverManager An OpenSource Project that helps one of the most commons nightmares while using Selenium: Managing the webdriver binaries. https://github.com/bonigarcia/webdrivermanager
  • 13. #TIP 4: MANAGING DRIVERS WITH WEBDRIVERMANAGER Copyright 2017 Accenture. All rights reserved. 13 Add the dependency Use the DriverManager
  • 14. #TIP 4: MANAGING DRIVERS WITH WEBDRIVERMANAGER Copyright 2017 Accenture. All rights reserved. 14 Fully configurable using the API Or parameters
  • 15. #TIP 5: XPATH IS NOT UNDER YOUR CONTROL Copyright 2017 Accenture. All rights reserved. 15
  • 16. XPath usage in Selenium depends on: Native capabilities for XPath of each browser If not available, Selenium provides its own implementation #TIP5: XPATH IS NOT UNDER YOUR CONTROL
  • 17. An example from the Selenium documentation #TIP5: XPATH IS NOT UNDER YOUR CONTROL
  • 18. COROLLARY: NEVER, NEVER USE XPATH Using XPath for interacting with your web is not a PREDICTABLE nor REPEATABLE approach.
  • 19. #TIP 6: ALTERNATIVES: PROVIDE PREDICTABLE ID TO YOUR WEB ELEMENTS Copyright 2017 Accenture. All rights reserved. 19
  • 20. Instead of investing a lot in creating highly complicated ways to interact with the elements in your application, consider change the application instead - Overriding ID of your web elements - Creating anchor elements that helps on accessing your elements #TIP6: ALTERNATIVES: PROVIDE PREDICTABLE ID TO YOUR WEB ELEMENTS
  • 21. COROLLARY: THINK ON TESTABILITY One of the drivers when you define your web framework should be the ability to test the application
  • 22. #TIP 7: USING API EFFECTIVELY: THE ISELECT INTERFACE Copyright 2017 Accenture. All rights reserved. 22
  • 23. The ISelect Interface provide methods to interact with elements of type Select. The Select implementation provides methods for: • Select (by Index, by Value, by Text) • Deselect (All, by Index, by Value, by Text) Works with MultiSelect #TIP7: USING API EFFECTIVELY: THE ISELECT INTERFACE
  • 24. #TIP 8: THE ACTION BUILDER CAN ALSO HELPS Copyright 2017 Accenture. All rights reserved. 24
  • 25. We are using Selenium to emulate human interaction with the application under test The Action Interface Builder can be useful when try to explicitly guide the interaction through your web page #TIP8: THE ACTION BUILDER CAN ALSO HELPS
  • 26. #TIP 9: CONTINUOUS TESTING FOR MICROSERVICES Copyright 2017 Accenture. All rights reserved. 26
  • 27. Jenkins as Orchestrator CONTINUOUS DELIVERY PIPELINES Copyright © 2017 Accenture. All rights reserved. 27 Test scope is limited to one service/app Test scope is end-to-end
  • 28. Jenkins as Orchestrator CONTINUOUS DELIVERY TRIGGERS Copyright © 2017 Accenture. All rights reserved. 28 Trigger on code/config/test change Tests are in the same code repo Trigger after any component is promoted and deployed Trigger on end-to-end test change End-to-end tests (and test data) are in separate code repo May reuse tests from components
  • 29. corollary: consider it as an application When you are using Selenium you are creating an application to test your application
  • 30. creditsRepositories: https://github.com/viarellano/deors.demos.petclinic https://github.com/deors/deors.demos.petclinic Presentation from JavaOne 2016 https://es.slideshare.net/deors/javaone-2016-con3080-testing- java-web-applications-with-selenium-a-cookbook