SlideShare una empresa de Scribd logo
1 de 27
Descargar para leer sin conexión
JAVA TEST AUTOMATION FOR
REST | WEB | MOBILE
E L I A S N O G U E I R A
@ e l i a s n o g u e i r a
E D S O N Y A N A G A
@ y a n a g a
Elias Nogueira
@eliasnogueira
Senior QA Engineer, Agile Coach & Trainer at Sicredi
Postgraduate Professor at Unisinos.br
Active community engagement
- The Developers Conference
- Google Developer Group
- Agile Coach Meetup
Edson Yanaga
@yanaga
Director of Developer Experience, Red Hat
Oracle Java Champion
Loren ipsus
Intermediate validation
between back and front end
Test in REST service
To guarantee stability during
continuous test cycles
Mock in REST service
Functional and Acceptance tests
on Mobile UI
Test in Mobile UI
Functional and Acceptance
tests on Web UI
Test in Web UI
TOOL BOX
The correct toolbox is a key in a automation process
REST API
Our API “documentation” (you may use swagger)
ExampleURLVerbAction
/api/v1/person/api/v1/personGETList persons
/api/v1/person/27/api/v1/person/:idGETGet person by id
/api/v1/person/api/v1/personPOSTCreate a person
/api/v1/person/33/api/v1/person/:idPUTUpdate a person by id
/api/v1/person/52/api/v1/person/:idDELETERemove a person by id
REST SERVICE AUTOMATION
One of the most important layer
Have same importance as UI has
Always assert business transactions
On new services, try do validate manually first
CURL (CLI)
PostMan (Standalone application | Google Chrome extension)
MOCK FOR REST TESTS
The easiest way to create mocks for test
Microframework with Java 8 power
Great choice for micro services
Easy REST implementation to create you own mock with real response
http://sparkjava.com
MOCK FOR REST TESTS
Because you will not test in production (all the time), right?
Mock example with fixed data
Using fixed data is a good solution to test with a
real data (req, res) without code changes
MOCK FOR REST TESTS
Mock example with dynamic data
Create a list of pre-defined data may be a good way to
manage the testing data
Because you will not test in production (all the time), right?
REST
ASSURED
Easy DSL for REST service automation
Uses the give-when-then (BDD) syntax
https://github.com/jayway/rest-assured
WHAT I NEED?
What is needed to create a REST test automation with RestAssured
Import some static classes
Set the base URI, base path and port (if needed)
import static io.restassured.RestAssured.*;
import static org.hamcrest.Matchers.*;
baseURI = "http://localhost";
basePath = "/api";
port = 4567;
REST TEST AUTOMATION
You need do set the URL, path and port
Before and After (setup | tearDown) for each tests
A good solution to start and stop your API mock
server using Spark
RestAssured has a fluent API to automate REST tests
RestAssured test example
Sending a GET with id 1 (given) and the assert
the response/results (then)
REST TEST AUTOMATION
SELENIUM
WEBDRIVER
Browser automation API for real browsers (including IE)
Can be controller by many programming languages
http://seleniumhq.org
W3C
Simulate an real user on browser
WHAT I NEED?
What you need to create your first web test with Selenium
Web browser and a driver*
A browser to use the inspect tool (native function in various browsers)
[ProTip] Use any software to change internet speed
* you will need a proper driver (executable file) to each browser
INSPECT AN WEB ELEMENT ON A BROWSER
A way to get the find an element for future utilization
Inspect
button
PROCESS TO CREATE WEB TEST SCRIPT
Easy process to create all yours web test scripts
Selenium test
script creation
process
Browser initialization and
navigation control
(back, forward, refresh)
Navigation
A way to find a web element
id, name, cssSelector, xpath
Interrogation
Wait for dynamic elements or
some asynchronous request based
on web elements
Synchronization
A way to interact with the web elements
click, clear, sendKeys, getText
Manipulation
1
2
3
4
WEB TEST AUTOMATION
Selenium has an easy DLS
Selenium Automated test
Complete example with navigation, interrogation, manipulation and synchronization
1
2
3
4
Use Page Objects to create modular test scripts
Apply design patterns in your test codebase
Execute web test in different internet speeds
Use XPATH only when needed
PRO TIPS FOR WEB TEST AUTOMATION
For a more professional test script
PRO-TIPS FOR YOUR WEB TEST SUITE
Is really important divide your tests into onto suites grouped by test levels
HEADLESS TEST ACCEPTANCE TEST FUNCTIONAL TEST
AUTOMATION TEST SUITE
1 2 3 4
GIVE FAST FEEDBACK FOR CONTINUOUS TEST CYCLES
TEST THE SYSTEM IN A USER PERSPECTIVE
TEST WITH A BUSINESS RULES PERSPECTIVE
1
2
3
APPIUM
API for automation on mobile devices
Android and iOS supported
http://appium.io
Execution on emulators, devices our cloud
Test on native or hybrid apps
WHAT I NEED?
Pre-reqs to create an automated test for mobile with Appium
Android SDK
Appium (via Appium.app or Nodejs)
Configure your path with (tools | platform-tools | tools/bin)
SDK Platform + System Image (to the emulator)
Emulator or Real Device
INSPECT COMPONENTS
You can inspect na component using uiautomatorviewer
Inspect
button
Inspected
component
Component
attributes
PROCESS TO CREATE MOBILE TEST SCRIPT
Easy process to create all your mobile test scripts
Appium test
script creation
process
Capabilities like Platform, Version,
Target app and others
DesiredCapabilities
Start the session between Appium
and Device (Appium.app or Nodejs)
Session
Wait for async requests basing on
components wait
Synchronization
The same way we do with Selenium
Find and interact with components
Interrogation and Manipulation
1
2
3
4
MOBILE TEST AUTOMATION
Despite of DesiredCapabilities and Session, is the same Selenium script
Example with a pre-installed app
Complete example targeting an Android platform
PRO TIPS FOR MOBILE TEST AUTOMATION
For a more professional test script
1
2
3
4
Execute tests with fresh and pre installed app
Create a test suite with user focus
Test on other networks(Wi-Fi, 3G…)
Test non-function req.
Thank you!
Code for the all apps (back-end, front-end and tests)
https://github.com/eliasnogueira/test-automation-javaone-2017

Más contenido relacionado

La actualidad más candente

Create an architecture for web test automation
Create an architecture for web test automationCreate an architecture for web test automation
Create an architecture for web test automationElias Nogueira
 
API Strategy Presentation
API Strategy PresentationAPI Strategy Presentation
API Strategy PresentationLawrence Coburn
 
Dagger Hilt Pros and Cons - Android Summit 2020
Dagger Hilt Pros and Cons - Android Summit 2020Dagger Hilt Pros and Cons - Android Summit 2020
Dagger Hilt Pros and Cons - Android Summit 2020Vasiliy Zukanov
 
Project meeting: Android Graphics Architecture Overview
Project meeting: Android Graphics Architecture OverviewProject meeting: Android Graphics Architecture Overview
Project meeting: Android Graphics Architecture OverviewYu-Hsin Hung
 
API Gateway를 이용한 토큰 기반 인증 아키텍처
API Gateway를 이용한 토큰 기반 인증 아키텍처API Gateway를 이용한 토큰 기반 인증 아키텍처
API Gateway를 이용한 토큰 기반 인증 아키텍처Yoonjeong Kwon
 
API Platform and Symfony: a Framework for API-driven Projects
API Platform and Symfony: a Framework for API-driven ProjectsAPI Platform and Symfony: a Framework for API-driven Projects
API Platform and Symfony: a Framework for API-driven ProjectsLes-Tilleuls.coop
 
Building a REST Service in minutes with Spring Boot
Building a REST Service in minutes with Spring BootBuilding a REST Service in minutes with Spring Boot
Building a REST Service in minutes with Spring BootOmri Spector
 
User Management Life Cycle with Keycloak
User Management Life Cycle with KeycloakUser Management Life Cycle with Keycloak
User Management Life Cycle with KeycloakMuhammad Edwin
 
APIsecure 2023 - API orchestration: to build resilient applications, Cherish ...
APIsecure 2023 - API orchestration: to build resilient applications, Cherish ...APIsecure 2023 - API orchestration: to build resilient applications, Cherish ...
APIsecure 2023 - API orchestration: to build resilient applications, Cherish ...apidays
 
Kong API Gateway
Kong API Gateway Kong API Gateway
Kong API Gateway Chris Mague
 
APIsecure 2023 - Approaching Multicloud API Security USing Metacloud, David L...
APIsecure 2023 - Approaching Multicloud API Security USing Metacloud, David L...APIsecure 2023 - Approaching Multicloud API Security USing Metacloud, David L...
APIsecure 2023 - Approaching Multicloud API Security USing Metacloud, David L...apidays
 
Api design best practice
Api design best practiceApi design best practice
Api design best practiceRed Hat
 
Flutter state management from zero to hero
Flutter state management from zero to heroFlutter state management from zero to hero
Flutter state management from zero to heroAhmed Abu Eldahab
 
REST API Design & Development
REST API Design & DevelopmentREST API Design & Development
REST API Design & DevelopmentAshok Pundit
 
The never-ending REST API design debate
The never-ending REST API design debateThe never-ending REST API design debate
The never-ending REST API design debateRestlet
 
GraphQL Story: Intro To GraphQL
GraphQL Story: Intro To GraphQLGraphQL Story: Intro To GraphQL
GraphQL Story: Intro To GraphQLRiza Fahmi
 
Security enforcement of Java Microservices with Apiman & Keycloak
Security enforcement of Java Microservices with Apiman & KeycloakSecurity enforcement of Java Microservices with Apiman & Keycloak
Security enforcement of Java Microservices with Apiman & KeycloakCharles Moulliard
 
Microservices & API Gateways
Microservices & API Gateways Microservices & API Gateways
Microservices & API Gateways Kong Inc.
 

La actualidad más candente (20)

Introduction to GraphQL
Introduction to GraphQLIntroduction to GraphQL
Introduction to GraphQL
 
Create an architecture for web test automation
Create an architecture for web test automationCreate an architecture for web test automation
Create an architecture for web test automation
 
API Strategy Presentation
API Strategy PresentationAPI Strategy Presentation
API Strategy Presentation
 
Dagger Hilt Pros and Cons - Android Summit 2020
Dagger Hilt Pros and Cons - Android Summit 2020Dagger Hilt Pros and Cons - Android Summit 2020
Dagger Hilt Pros and Cons - Android Summit 2020
 
Project meeting: Android Graphics Architecture Overview
Project meeting: Android Graphics Architecture OverviewProject meeting: Android Graphics Architecture Overview
Project meeting: Android Graphics Architecture Overview
 
API Gateway를 이용한 토큰 기반 인증 아키텍처
API Gateway를 이용한 토큰 기반 인증 아키텍처API Gateway를 이용한 토큰 기반 인증 아키텍처
API Gateway를 이용한 토큰 기반 인증 아키텍처
 
API Platform and Symfony: a Framework for API-driven Projects
API Platform and Symfony: a Framework for API-driven ProjectsAPI Platform and Symfony: a Framework for API-driven Projects
API Platform and Symfony: a Framework for API-driven Projects
 
Building a REST Service in minutes with Spring Boot
Building a REST Service in minutes with Spring BootBuilding a REST Service in minutes with Spring Boot
Building a REST Service in minutes with Spring Boot
 
User Management Life Cycle with Keycloak
User Management Life Cycle with KeycloakUser Management Life Cycle with Keycloak
User Management Life Cycle with Keycloak
 
APIsecure 2023 - API orchestration: to build resilient applications, Cherish ...
APIsecure 2023 - API orchestration: to build resilient applications, Cherish ...APIsecure 2023 - API orchestration: to build resilient applications, Cherish ...
APIsecure 2023 - API orchestration: to build resilient applications, Cherish ...
 
Kong API Gateway
Kong API Gateway Kong API Gateway
Kong API Gateway
 
APIsecure 2023 - Approaching Multicloud API Security USing Metacloud, David L...
APIsecure 2023 - Approaching Multicloud API Security USing Metacloud, David L...APIsecure 2023 - Approaching Multicloud API Security USing Metacloud, David L...
APIsecure 2023 - Approaching Multicloud API Security USing Metacloud, David L...
 
Api design best practice
Api design best practiceApi design best practice
Api design best practice
 
Flutter state management from zero to hero
Flutter state management from zero to heroFlutter state management from zero to hero
Flutter state management from zero to hero
 
REST API Design & Development
REST API Design & DevelopmentREST API Design & Development
REST API Design & Development
 
The never-ending REST API design debate
The never-ending REST API design debateThe never-ending REST API design debate
The never-ending REST API design debate
 
GraphQL Story: Intro To GraphQL
GraphQL Story: Intro To GraphQLGraphQL Story: Intro To GraphQL
GraphQL Story: Intro To GraphQL
 
Security enforcement of Java Microservices with Apiman & Keycloak
Security enforcement of Java Microservices with Apiman & KeycloakSecurity enforcement of Java Microservices with Apiman & Keycloak
Security enforcement of Java Microservices with Apiman & Keycloak
 
DevOps Best Practices
DevOps Best PracticesDevOps Best Practices
DevOps Best Practices
 
Microservices & API Gateways
Microservices & API Gateways Microservices & API Gateways
Microservices & API Gateways
 

Similar a Java Test Automation for REST, Web and Mobile

Good practices for debugging Selenium and Appium tests
Good practices for debugging Selenium and Appium testsGood practices for debugging Selenium and Appium tests
Good practices for debugging Selenium and Appium testsAbhijeet Vaikar
 
Discover the power of QA automation testing
Discover the power of QA automation testingDiscover the power of QA automation testing
Discover the power of QA automation testingSoftweb Solutions
 
Zagat.com Case Study (DrupalCon Denver 2012)
Zagat.com Case Study (DrupalCon Denver 2012)Zagat.com Case Study (DrupalCon Denver 2012)
Zagat.com Case Study (DrupalCon Denver 2012)Phase2
 
VishalSinha_Resume_Ora
VishalSinha_Resume_OraVishalSinha_Resume_Ora
VishalSinha_Resume_OraVishal Sinha
 
Anatomy of a Build Pipeline
Anatomy of a Build PipelineAnatomy of a Build Pipeline
Anatomy of a Build PipelineSamuel Brown
 
Integrate Your Test Automation Tools for More Power
Integrate Your Test Automation Tools for More PowerIntegrate Your Test Automation Tools for More Power
Integrate Your Test Automation Tools for More PowerTechWell
 
Enterprise Ready Test Execution Platform for Mobile Apps
Enterprise Ready Test Execution Platform for Mobile AppsEnterprise Ready Test Execution Platform for Mobile Apps
Enterprise Ready Test Execution Platform for Mobile AppsVijayan Srinivasan
 
AWS Summit Auckland - Application Delivery Patterns for Developers
AWS Summit Auckland - Application Delivery Patterns for DevelopersAWS Summit Auckland - Application Delivery Patterns for Developers
AWS Summit Auckland - Application Delivery Patterns for DevelopersAmazon Web Services
 
JOSA TechTalks - RESTful API Concepts and Best Practices
JOSA TechTalks - RESTful API Concepts and Best PracticesJOSA TechTalks - RESTful API Concepts and Best Practices
JOSA TechTalks - RESTful API Concepts and Best PracticesJordan Open Source Association
 
Google App Engine for Java
Google App Engine for JavaGoogle App Engine for Java
Google App Engine for JavaLars Vogel
 
Тестирование мобильных приложений используя облачные сервисы. TestDroid, Test...
Тестирование мобильных приложений используя облачные сервисы. TestDroid, Test...Тестирование мобильных приложений используя облачные сервисы. TestDroid, Test...
Тестирование мобильных приложений используя облачные сервисы. TestDroid, Test...COMAQA.BY
 
Webinar: Automate Your Environment Provisioning for Mobile App Development
Webinar: Automate Your Environment Provisioning for Mobile App Development Webinar: Automate Your Environment Provisioning for Mobile App Development
Webinar: Automate Your Environment Provisioning for Mobile App Development Skytap Cloud
 
Pragmatic Parallels: Java and JavaScript
Pragmatic Parallels: Java and JavaScriptPragmatic Parallels: Java and JavaScript
Pragmatic Parallels: Java and JavaScriptdavejohnson
 
[DevDay 2017] Automation Testing - Speaker: Nghia Khuong - Project Manager at...
[DevDay 2017] Automation Testing - Speaker: Nghia Khuong - Project Manager at...[DevDay 2017] Automation Testing - Speaker: Nghia Khuong - Project Manager at...
[DevDay 2017] Automation Testing - Speaker: Nghia Khuong - Project Manager at...DevDay.org
 
Ramesh Krishnamurthy, CTO at World DevOps Summit 2016
Ramesh Krishnamurthy, CTO at World DevOps Summit 2016Ramesh Krishnamurthy, CTO at World DevOps Summit 2016
Ramesh Krishnamurthy, CTO at World DevOps Summit 2016Indium Software
 
Basics of Scriptless Automation for Web and Mobile Apps (1).pdf
Basics of Scriptless Automation for Web and Mobile Apps (1).pdfBasics of Scriptless Automation for Web and Mobile Apps (1).pdf
Basics of Scriptless Automation for Web and Mobile Apps (1).pdfpcloudy2
 
Visual Studio ALM and DevOps Tools Walkthrough
Visual Studio ALM and DevOps Tools WalkthroughVisual Studio ALM and DevOps Tools Walkthrough
Visual Studio ALM and DevOps Tools WalkthroughAngela Dugan
 

Similar a Java Test Automation for REST, Web and Mobile (20)

Rajiv Profile
Rajiv ProfileRajiv Profile
Rajiv Profile
 
Good practices for debugging Selenium and Appium tests
Good practices for debugging Selenium and Appium testsGood practices for debugging Selenium and Appium tests
Good practices for debugging Selenium and Appium tests
 
Discover the power of QA automation testing
Discover the power of QA automation testingDiscover the power of QA automation testing
Discover the power of QA automation testing
 
Zagat.com Case Study (DrupalCon Denver 2012)
Zagat.com Case Study (DrupalCon Denver 2012)Zagat.com Case Study (DrupalCon Denver 2012)
Zagat.com Case Study (DrupalCon Denver 2012)
 
VishalSinha_Resume_Ora
VishalSinha_Resume_OraVishalSinha_Resume_Ora
VishalSinha_Resume_Ora
 
Anatomy of a Build Pipeline
Anatomy of a Build PipelineAnatomy of a Build Pipeline
Anatomy of a Build Pipeline
 
Integrate Your Test Automation Tools for More Power
Integrate Your Test Automation Tools for More PowerIntegrate Your Test Automation Tools for More Power
Integrate Your Test Automation Tools for More Power
 
Enterprise Ready Test Execution Platform for Mobile Apps
Enterprise Ready Test Execution Platform for Mobile AppsEnterprise Ready Test Execution Platform for Mobile Apps
Enterprise Ready Test Execution Platform for Mobile Apps
 
AWS Summit Auckland - Application Delivery Patterns for Developers
AWS Summit Auckland - Application Delivery Patterns for DevelopersAWS Summit Auckland - Application Delivery Patterns for Developers
AWS Summit Auckland - Application Delivery Patterns for Developers
 
JOSA TechTalks - RESTful API Concepts and Best Practices
JOSA TechTalks - RESTful API Concepts and Best PracticesJOSA TechTalks - RESTful API Concepts and Best Practices
JOSA TechTalks - RESTful API Concepts and Best Practices
 
Google App Engine for Java
Google App Engine for JavaGoogle App Engine for Java
Google App Engine for Java
 
Тестирование мобильных приложений используя облачные сервисы. TestDroid, Test...
Тестирование мобильных приложений используя облачные сервисы. TestDroid, Test...Тестирование мобильных приложений используя облачные сервисы. TestDroid, Test...
Тестирование мобильных приложений используя облачные сервисы. TestDroid, Test...
 
Webinar: Automate Your Environment Provisioning for Mobile App Development
Webinar: Automate Your Environment Provisioning for Mobile App Development Webinar: Automate Your Environment Provisioning for Mobile App Development
Webinar: Automate Your Environment Provisioning for Mobile App Development
 
Shruti Kulkarni (1)
Shruti Kulkarni (1)Shruti Kulkarni (1)
Shruti Kulkarni (1)
 
Pragmatic Parallels: Java and JavaScript
Pragmatic Parallels: Java and JavaScriptPragmatic Parallels: Java and JavaScript
Pragmatic Parallels: Java and JavaScript
 
[DevDay 2017] Automation Testing - Speaker: Nghia Khuong - Project Manager at...
[DevDay 2017] Automation Testing - Speaker: Nghia Khuong - Project Manager at...[DevDay 2017] Automation Testing - Speaker: Nghia Khuong - Project Manager at...
[DevDay 2017] Automation Testing - Speaker: Nghia Khuong - Project Manager at...
 
Ramesh Krishnamurthy, CTO at World DevOps Summit 2016
Ramesh Krishnamurthy, CTO at World DevOps Summit 2016Ramesh Krishnamurthy, CTO at World DevOps Summit 2016
Ramesh Krishnamurthy, CTO at World DevOps Summit 2016
 
Basics of Scriptless Automation for Web and Mobile Apps (1).pdf
Basics of Scriptless Automation for Web and Mobile Apps (1).pdfBasics of Scriptless Automation for Web and Mobile Apps (1).pdf
Basics of Scriptless Automation for Web and Mobile Apps (1).pdf
 
Shashank_Venkataramanacharya
Shashank_VenkataramanacharyaShashank_Venkataramanacharya
Shashank_Venkataramanacharya
 
Visual Studio ALM and DevOps Tools Walkthrough
Visual Studio ALM and DevOps Tools WalkthroughVisual Studio ALM and DevOps Tools Walkthrough
Visual Studio ALM and DevOps Tools Walkthrough
 

Más de Elias Nogueira

Criando uma arquitetura para seus testes de API com RestAssured
Criando uma arquitetura para seus testes de API com RestAssuredCriando uma arquitetura para seus testes de API com RestAssured
Criando uma arquitetura para seus testes de API com RestAssuredElias Nogueira
 
De a máxima cobertura nos seus testes de API
De a máxima cobertura nos seus testes de APIDe a máxima cobertura nos seus testes de API
De a máxima cobertura nos seus testes de APIElias Nogueira
 
Automação e virtualização de serviços
Automação e virtualização de serviçosAutomação e virtualização de serviços
Automação e virtualização de serviçosElias Nogueira
 
Usando containers com auto-escala de testes
Usando containers com auto-escala de testesUsando containers com auto-escala de testes
Usando containers com auto-escala de testesElias Nogueira
 
Coach por Imersão - Buscando a excelência técnica com o time
Coach por Imersão - Buscando a excelência técnica com o timeCoach por Imersão - Buscando a excelência técnica com o time
Coach por Imersão - Buscando a excelência técnica com o timeElias Nogueira
 
O Agile Coach pode (e muitas vezes deve) ser técnico
O Agile Coach pode (e muitas vezes deve) ser técnicoO Agile Coach pode (e muitas vezes deve) ser técnico
O Agile Coach pode (e muitas vezes deve) ser técnicoElias Nogueira
 
Paralelize seus testes web e mobile para ter feedbacks mais rápidos
Paralelize seus testes web e mobile para ter feedbacks mais rápidosParalelize seus testes web e mobile para ter feedbacks mais rápidos
Paralelize seus testes web e mobile para ter feedbacks mais rápidosElias Nogueira
 
Como 4 Agile Coaches trabalham em uma Transformação Ágil
Como 4 Agile Coaches trabalham em uma Transformação Ágil Como 4 Agile Coaches trabalham em uma Transformação Ágil
Como 4 Agile Coaches trabalham em uma Transformação Ágil Elias Nogueira
 
Papel do QA na Transformação Ágil
Papel do QA na Transformação ÁgilPapel do QA na Transformação Ágil
Papel do QA na Transformação ÁgilElias Nogueira
 
BDD não é automação de teste - Scrum Gathering
BDD não é automação de teste - Scrum GatheringBDD não é automação de teste - Scrum Gathering
BDD não é automação de teste - Scrum GatheringElias Nogueira
 
Como criar e executar testes paralelos web usando Selenium e containers
Como criar e executar testes paralelos web usando Selenium e containersComo criar e executar testes paralelos web usando Selenium e containers
Como criar e executar testes paralelos web usando Selenium e containersElias Nogueira
 
Improve Yourself -- Learn the Skills, Join the Community - Tests
Improve Yourself -- Learn the Skills, Join the Community - TestsImprove Yourself -- Learn the Skills, Join the Community - Tests
Improve Yourself -- Learn the Skills, Join the Community - TestsElias Nogueira
 
Confie no seu pipeline: Teste automaticamente um aplicativo Java de ponta a p...
Confie no seu pipeline: Teste automaticamente um aplicativo Java de ponta a p...Confie no seu pipeline: Teste automaticamente um aplicativo Java de ponta a p...
Confie no seu pipeline: Teste automaticamente um aplicativo Java de ponta a p...Elias Nogueira
 
BDD não é Automação de Testes
BDD não é Automação de TestesBDD não é Automação de Testes
BDD não é Automação de TestesElias Nogueira
 
Criando uma grid para execução de testes paralelo com Appium
Criando uma grid para execução de testes paralelo com AppiumCriando uma grid para execução de testes paralelo com Appium
Criando uma grid para execução de testes paralelo com AppiumElias Nogueira
 
Como ter sucesso ministrando uma palestra técnica
Como ter sucesso ministrando uma palestra técnicaComo ter sucesso ministrando uma palestra técnica
Como ter sucesso ministrando uma palestra técnicaElias Nogueira
 
Quais são os steps de que deve conter na sua pipeline?
Quais são os steps de que deve conter na sua pipeline?Quais são os steps de que deve conter na sua pipeline?
Quais são os steps de que deve conter na sua pipeline?Elias Nogueira
 
Testes em todos os niveis de planejamento
Testes em todos os niveis de planejamentoTestes em todos os niveis de planejamento
Testes em todos os niveis de planejamentoElias Nogueira
 
Coaching the Agile Coach
Coaching the Agile CoachCoaching the Agile Coach
Coaching the Agile CoachElias Nogueira
 

Más de Elias Nogueira (20)

Criando uma arquitetura para seus testes de API com RestAssured
Criando uma arquitetura para seus testes de API com RestAssuredCriando uma arquitetura para seus testes de API com RestAssured
Criando uma arquitetura para seus testes de API com RestAssured
 
De a máxima cobertura nos seus testes de API
De a máxima cobertura nos seus testes de APIDe a máxima cobertura nos seus testes de API
De a máxima cobertura nos seus testes de API
 
Automação e virtualização de serviços
Automação e virtualização de serviçosAutomação e virtualização de serviços
Automação e virtualização de serviços
 
Usando containers com auto-escala de testes
Usando containers com auto-escala de testesUsando containers com auto-escala de testes
Usando containers com auto-escala de testes
 
Coach por Imersão - Buscando a excelência técnica com o time
Coach por Imersão - Buscando a excelência técnica com o timeCoach por Imersão - Buscando a excelência técnica com o time
Coach por Imersão - Buscando a excelência técnica com o time
 
O Agile Coach pode (e muitas vezes deve) ser técnico
O Agile Coach pode (e muitas vezes deve) ser técnicoO Agile Coach pode (e muitas vezes deve) ser técnico
O Agile Coach pode (e muitas vezes deve) ser técnico
 
Paralelize seus testes web e mobile para ter feedbacks mais rápidos
Paralelize seus testes web e mobile para ter feedbacks mais rápidosParalelize seus testes web e mobile para ter feedbacks mais rápidos
Paralelize seus testes web e mobile para ter feedbacks mais rápidos
 
Como 4 Agile Coaches trabalham em uma Transformação Ágil
Como 4 Agile Coaches trabalham em uma Transformação Ágil Como 4 Agile Coaches trabalham em uma Transformação Ágil
Como 4 Agile Coaches trabalham em uma Transformação Ágil
 
Papel do QA na Transformação Ágil
Papel do QA na Transformação ÁgilPapel do QA na Transformação Ágil
Papel do QA na Transformação Ágil
 
BDD não é automação de teste - Scrum Gathering
BDD não é automação de teste - Scrum GatheringBDD não é automação de teste - Scrum Gathering
BDD não é automação de teste - Scrum Gathering
 
Como criar e executar testes paralelos web usando Selenium e containers
Como criar e executar testes paralelos web usando Selenium e containersComo criar e executar testes paralelos web usando Selenium e containers
Como criar e executar testes paralelos web usando Selenium e containers
 
Improve Yourself -- Learn the Skills, Join the Community - Tests
Improve Yourself -- Learn the Skills, Join the Community - TestsImprove Yourself -- Learn the Skills, Join the Community - Tests
Improve Yourself -- Learn the Skills, Join the Community - Tests
 
Confie no seu pipeline: Teste automaticamente um aplicativo Java de ponta a p...
Confie no seu pipeline: Teste automaticamente um aplicativo Java de ponta a p...Confie no seu pipeline: Teste automaticamente um aplicativo Java de ponta a p...
Confie no seu pipeline: Teste automaticamente um aplicativo Java de ponta a p...
 
BDD não é Automação de Testes
BDD não é Automação de TestesBDD não é Automação de Testes
BDD não é Automação de Testes
 
Criando uma grid para execução de testes paralelo com Appium
Criando uma grid para execução de testes paralelo com AppiumCriando uma grid para execução de testes paralelo com Appium
Criando uma grid para execução de testes paralelo com Appium
 
Como ter sucesso ministrando uma palestra técnica
Como ter sucesso ministrando uma palestra técnicaComo ter sucesso ministrando uma palestra técnica
Como ter sucesso ministrando uma palestra técnica
 
Quais são os steps de que deve conter na sua pipeline?
Quais são os steps de que deve conter na sua pipeline?Quais são os steps de que deve conter na sua pipeline?
Quais são os steps de que deve conter na sua pipeline?
 
Tem que testar mesmo?
Tem que testar mesmo?Tem que testar mesmo?
Tem que testar mesmo?
 
Testes em todos os niveis de planejamento
Testes em todos os niveis de planejamentoTestes em todos os niveis de planejamento
Testes em todos os niveis de planejamento
 
Coaching the Agile Coach
Coaching the Agile CoachCoaching the Agile Coach
Coaching the Agile Coach
 

Último

WSO2CON 2024 - Building the API First Enterprise – Running an API Program, fr...
WSO2CON 2024 - Building the API First Enterprise – Running an API Program, fr...WSO2CON 2024 - Building the API First Enterprise – Running an API Program, fr...
WSO2CON 2024 - Building the API First Enterprise – Running an API Program, fr...WSO2
 
Crypto Cloud Review - How To Earn Up To $500 Per DAY Of Bitcoin 100% On AutoP...
Crypto Cloud Review - How To Earn Up To $500 Per DAY Of Bitcoin 100% On AutoP...Crypto Cloud Review - How To Earn Up To $500 Per DAY Of Bitcoin 100% On AutoP...
Crypto Cloud Review - How To Earn Up To $500 Per DAY Of Bitcoin 100% On AutoP...SelfMade bd
 
%in kaalfontein+277-882-255-28 abortion pills for sale in kaalfontein
%in kaalfontein+277-882-255-28 abortion pills for sale in kaalfontein%in kaalfontein+277-882-255-28 abortion pills for sale in kaalfontein
%in kaalfontein+277-882-255-28 abortion pills for sale in kaalfonteinmasabamasaba
 
%+27788225528 love spells in Atlanta Psychic Readings, Attraction spells,Brin...
%+27788225528 love spells in Atlanta Psychic Readings, Attraction spells,Brin...%+27788225528 love spells in Atlanta Psychic Readings, Attraction spells,Brin...
%+27788225528 love spells in Atlanta Psychic Readings, Attraction spells,Brin...masabamasaba
 
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...Health
 
MarTech Trend 2024 Book : Marketing Technology Trends (2024 Edition) How Data...
MarTech Trend 2024 Book : Marketing Technology Trends (2024 Edition) How Data...MarTech Trend 2024 Book : Marketing Technology Trends (2024 Edition) How Data...
MarTech Trend 2024 Book : Marketing Technology Trends (2024 Edition) How Data...Jittipong Loespradit
 
%in Midrand+277-882-255-28 abortion pills for sale in midrand
%in Midrand+277-882-255-28 abortion pills for sale in midrand%in Midrand+277-882-255-28 abortion pills for sale in midrand
%in Midrand+277-882-255-28 abortion pills for sale in midrandmasabamasaba
 
What Goes Wrong with Language Definitions and How to Improve the Situation
What Goes Wrong with Language Definitions and How to Improve the SituationWhat Goes Wrong with Language Definitions and How to Improve the Situation
What Goes Wrong with Language Definitions and How to Improve the SituationJuha-Pekka Tolvanen
 
%+27788225528 love spells in Huntington Beach Psychic Readings, Attraction sp...
%+27788225528 love spells in Huntington Beach Psychic Readings, Attraction sp...%+27788225528 love spells in Huntington Beach Psychic Readings, Attraction sp...
%+27788225528 love spells in Huntington Beach Psychic Readings, Attraction sp...masabamasaba
 
%in tembisa+277-882-255-28 abortion pills for sale in tembisa
%in tembisa+277-882-255-28 abortion pills for sale in tembisa%in tembisa+277-882-255-28 abortion pills for sale in tembisa
%in tembisa+277-882-255-28 abortion pills for sale in tembisamasabamasaba
 
8257 interfacing 2 in microprocessor for btech students
8257 interfacing 2 in microprocessor for btech students8257 interfacing 2 in microprocessor for btech students
8257 interfacing 2 in microprocessor for btech studentsHimanshiGarg82
 
%+27788225528 love spells in new york Psychic Readings, Attraction spells,Bri...
%+27788225528 love spells in new york Psychic Readings, Attraction spells,Bri...%+27788225528 love spells in new york Psychic Readings, Attraction spells,Bri...
%+27788225528 love spells in new york Psychic Readings, Attraction spells,Bri...masabamasaba
 
%+27788225528 love spells in Toronto Psychic Readings, Attraction spells,Brin...
%+27788225528 love spells in Toronto Psychic Readings, Attraction spells,Brin...%+27788225528 love spells in Toronto Psychic Readings, Attraction spells,Brin...
%+27788225528 love spells in Toronto Psychic Readings, Attraction spells,Brin...masabamasaba
 
WSO2CON2024 - It's time to go Platformless
WSO2CON2024 - It's time to go PlatformlessWSO2CON2024 - It's time to go Platformless
WSO2CON2024 - It's time to go PlatformlessWSO2
 
%in ivory park+277-882-255-28 abortion pills for sale in ivory park
%in ivory park+277-882-255-28 abortion pills for sale in ivory park %in ivory park+277-882-255-28 abortion pills for sale in ivory park
%in ivory park+277-882-255-28 abortion pills for sale in ivory park masabamasaba
 
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...Steffen Staab
 
VTU technical seminar 8Th Sem on Scikit-learn
VTU technical seminar 8Th Sem on Scikit-learnVTU technical seminar 8Th Sem on Scikit-learn
VTU technical seminar 8Th Sem on Scikit-learnAmarnathKambale
 
%+27788225528 love spells in Knoxville Psychic Readings, Attraction spells,Br...
%+27788225528 love spells in Knoxville Psychic Readings, Attraction spells,Br...%+27788225528 love spells in Knoxville Psychic Readings, Attraction spells,Br...
%+27788225528 love spells in Knoxville Psychic Readings, Attraction spells,Br...masabamasaba
 
Announcing Codolex 2.0 from GDK Software
Announcing Codolex 2.0 from GDK SoftwareAnnouncing Codolex 2.0 from GDK Software
Announcing Codolex 2.0 from GDK SoftwareJim McKeeth
 

Último (20)

WSO2CON 2024 - Building the API First Enterprise – Running an API Program, fr...
WSO2CON 2024 - Building the API First Enterprise – Running an API Program, fr...WSO2CON 2024 - Building the API First Enterprise – Running an API Program, fr...
WSO2CON 2024 - Building the API First Enterprise – Running an API Program, fr...
 
Crypto Cloud Review - How To Earn Up To $500 Per DAY Of Bitcoin 100% On AutoP...
Crypto Cloud Review - How To Earn Up To $500 Per DAY Of Bitcoin 100% On AutoP...Crypto Cloud Review - How To Earn Up To $500 Per DAY Of Bitcoin 100% On AutoP...
Crypto Cloud Review - How To Earn Up To $500 Per DAY Of Bitcoin 100% On AutoP...
 
%in kaalfontein+277-882-255-28 abortion pills for sale in kaalfontein
%in kaalfontein+277-882-255-28 abortion pills for sale in kaalfontein%in kaalfontein+277-882-255-28 abortion pills for sale in kaalfontein
%in kaalfontein+277-882-255-28 abortion pills for sale in kaalfontein
 
%+27788225528 love spells in Atlanta Psychic Readings, Attraction spells,Brin...
%+27788225528 love spells in Atlanta Psychic Readings, Attraction spells,Brin...%+27788225528 love spells in Atlanta Psychic Readings, Attraction spells,Brin...
%+27788225528 love spells in Atlanta Psychic Readings, Attraction spells,Brin...
 
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
 
MarTech Trend 2024 Book : Marketing Technology Trends (2024 Edition) How Data...
MarTech Trend 2024 Book : Marketing Technology Trends (2024 Edition) How Data...MarTech Trend 2024 Book : Marketing Technology Trends (2024 Edition) How Data...
MarTech Trend 2024 Book : Marketing Technology Trends (2024 Edition) How Data...
 
%in Midrand+277-882-255-28 abortion pills for sale in midrand
%in Midrand+277-882-255-28 abortion pills for sale in midrand%in Midrand+277-882-255-28 abortion pills for sale in midrand
%in Midrand+277-882-255-28 abortion pills for sale in midrand
 
What Goes Wrong with Language Definitions and How to Improve the Situation
What Goes Wrong with Language Definitions and How to Improve the SituationWhat Goes Wrong with Language Definitions and How to Improve the Situation
What Goes Wrong with Language Definitions and How to Improve the Situation
 
%+27788225528 love spells in Huntington Beach Psychic Readings, Attraction sp...
%+27788225528 love spells in Huntington Beach Psychic Readings, Attraction sp...%+27788225528 love spells in Huntington Beach Psychic Readings, Attraction sp...
%+27788225528 love spells in Huntington Beach Psychic Readings, Attraction sp...
 
%in tembisa+277-882-255-28 abortion pills for sale in tembisa
%in tembisa+277-882-255-28 abortion pills for sale in tembisa%in tembisa+277-882-255-28 abortion pills for sale in tembisa
%in tembisa+277-882-255-28 abortion pills for sale in tembisa
 
8257 interfacing 2 in microprocessor for btech students
8257 interfacing 2 in microprocessor for btech students8257 interfacing 2 in microprocessor for btech students
8257 interfacing 2 in microprocessor for btech students
 
%+27788225528 love spells in new york Psychic Readings, Attraction spells,Bri...
%+27788225528 love spells in new york Psychic Readings, Attraction spells,Bri...%+27788225528 love spells in new york Psychic Readings, Attraction spells,Bri...
%+27788225528 love spells in new york Psychic Readings, Attraction spells,Bri...
 
%+27788225528 love spells in Toronto Psychic Readings, Attraction spells,Brin...
%+27788225528 love spells in Toronto Psychic Readings, Attraction spells,Brin...%+27788225528 love spells in Toronto Psychic Readings, Attraction spells,Brin...
%+27788225528 love spells in Toronto Psychic Readings, Attraction spells,Brin...
 
Microsoft AI Transformation Partner Playbook.pdf
Microsoft AI Transformation Partner Playbook.pdfMicrosoft AI Transformation Partner Playbook.pdf
Microsoft AI Transformation Partner Playbook.pdf
 
WSO2CON2024 - It's time to go Platformless
WSO2CON2024 - It's time to go PlatformlessWSO2CON2024 - It's time to go Platformless
WSO2CON2024 - It's time to go Platformless
 
%in ivory park+277-882-255-28 abortion pills for sale in ivory park
%in ivory park+277-882-255-28 abortion pills for sale in ivory park %in ivory park+277-882-255-28 abortion pills for sale in ivory park
%in ivory park+277-882-255-28 abortion pills for sale in ivory park
 
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...
 
VTU technical seminar 8Th Sem on Scikit-learn
VTU technical seminar 8Th Sem on Scikit-learnVTU technical seminar 8Th Sem on Scikit-learn
VTU technical seminar 8Th Sem on Scikit-learn
 
%+27788225528 love spells in Knoxville Psychic Readings, Attraction spells,Br...
%+27788225528 love spells in Knoxville Psychic Readings, Attraction spells,Br...%+27788225528 love spells in Knoxville Psychic Readings, Attraction spells,Br...
%+27788225528 love spells in Knoxville Psychic Readings, Attraction spells,Br...
 
Announcing Codolex 2.0 from GDK Software
Announcing Codolex 2.0 from GDK SoftwareAnnouncing Codolex 2.0 from GDK Software
Announcing Codolex 2.0 from GDK Software
 

Java Test Automation for REST, Web and Mobile

  • 1. JAVA TEST AUTOMATION FOR REST | WEB | MOBILE E L I A S N O G U E I R A @ e l i a s n o g u e i r a E D S O N Y A N A G A @ y a n a g a
  • 2. Elias Nogueira @eliasnogueira Senior QA Engineer, Agile Coach & Trainer at Sicredi Postgraduate Professor at Unisinos.br Active community engagement - The Developers Conference - Google Developer Group - Agile Coach Meetup
  • 3. Edson Yanaga @yanaga Director of Developer Experience, Red Hat Oracle Java Champion Loren ipsus
  • 4. Intermediate validation between back and front end Test in REST service To guarantee stability during continuous test cycles Mock in REST service Functional and Acceptance tests on Mobile UI Test in Mobile UI Functional and Acceptance tests on Web UI Test in Web UI TOOL BOX The correct toolbox is a key in a automation process
  • 5. REST API Our API “documentation” (you may use swagger) ExampleURLVerbAction /api/v1/person/api/v1/personGETList persons /api/v1/person/27/api/v1/person/:idGETGet person by id /api/v1/person/api/v1/personPOSTCreate a person /api/v1/person/33/api/v1/person/:idPUTUpdate a person by id /api/v1/person/52/api/v1/person/:idDELETERemove a person by id
  • 6. REST SERVICE AUTOMATION One of the most important layer Have same importance as UI has Always assert business transactions On new services, try do validate manually first CURL (CLI) PostMan (Standalone application | Google Chrome extension)
  • 7. MOCK FOR REST TESTS The easiest way to create mocks for test Microframework with Java 8 power Great choice for micro services Easy REST implementation to create you own mock with real response http://sparkjava.com
  • 8. MOCK FOR REST TESTS Because you will not test in production (all the time), right? Mock example with fixed data Using fixed data is a good solution to test with a real data (req, res) without code changes
  • 9. MOCK FOR REST TESTS Mock example with dynamic data Create a list of pre-defined data may be a good way to manage the testing data Because you will not test in production (all the time), right?
  • 10. REST ASSURED Easy DSL for REST service automation Uses the give-when-then (BDD) syntax https://github.com/jayway/rest-assured
  • 11. WHAT I NEED? What is needed to create a REST test automation with RestAssured Import some static classes Set the base URI, base path and port (if needed) import static io.restassured.RestAssured.*; import static org.hamcrest.Matchers.*; baseURI = "http://localhost"; basePath = "/api"; port = 4567;
  • 12. REST TEST AUTOMATION You need do set the URL, path and port Before and After (setup | tearDown) for each tests A good solution to start and stop your API mock server using Spark
  • 13. RestAssured has a fluent API to automate REST tests RestAssured test example Sending a GET with id 1 (given) and the assert the response/results (then) REST TEST AUTOMATION
  • 14. SELENIUM WEBDRIVER Browser automation API for real browsers (including IE) Can be controller by many programming languages http://seleniumhq.org W3C Simulate an real user on browser
  • 15. WHAT I NEED? What you need to create your first web test with Selenium Web browser and a driver* A browser to use the inspect tool (native function in various browsers) [ProTip] Use any software to change internet speed * you will need a proper driver (executable file) to each browser
  • 16. INSPECT AN WEB ELEMENT ON A BROWSER A way to get the find an element for future utilization Inspect button
  • 17. PROCESS TO CREATE WEB TEST SCRIPT Easy process to create all yours web test scripts Selenium test script creation process Browser initialization and navigation control (back, forward, refresh) Navigation A way to find a web element id, name, cssSelector, xpath Interrogation Wait for dynamic elements or some asynchronous request based on web elements Synchronization A way to interact with the web elements click, clear, sendKeys, getText Manipulation 1 2 3 4
  • 18. WEB TEST AUTOMATION Selenium has an easy DLS Selenium Automated test Complete example with navigation, interrogation, manipulation and synchronization
  • 19. 1 2 3 4 Use Page Objects to create modular test scripts Apply design patterns in your test codebase Execute web test in different internet speeds Use XPATH only when needed PRO TIPS FOR WEB TEST AUTOMATION For a more professional test script
  • 20. PRO-TIPS FOR YOUR WEB TEST SUITE Is really important divide your tests into onto suites grouped by test levels HEADLESS TEST ACCEPTANCE TEST FUNCTIONAL TEST AUTOMATION TEST SUITE 1 2 3 4 GIVE FAST FEEDBACK FOR CONTINUOUS TEST CYCLES TEST THE SYSTEM IN A USER PERSPECTIVE TEST WITH A BUSINESS RULES PERSPECTIVE 1 2 3
  • 21. APPIUM API for automation on mobile devices Android and iOS supported http://appium.io Execution on emulators, devices our cloud Test on native or hybrid apps
  • 22. WHAT I NEED? Pre-reqs to create an automated test for mobile with Appium Android SDK Appium (via Appium.app or Nodejs) Configure your path with (tools | platform-tools | tools/bin) SDK Platform + System Image (to the emulator) Emulator or Real Device
  • 23. INSPECT COMPONENTS You can inspect na component using uiautomatorviewer Inspect button Inspected component Component attributes
  • 24. PROCESS TO CREATE MOBILE TEST SCRIPT Easy process to create all your mobile test scripts Appium test script creation process Capabilities like Platform, Version, Target app and others DesiredCapabilities Start the session between Appium and Device (Appium.app or Nodejs) Session Wait for async requests basing on components wait Synchronization The same way we do with Selenium Find and interact with components Interrogation and Manipulation 1 2 3 4
  • 25. MOBILE TEST AUTOMATION Despite of DesiredCapabilities and Session, is the same Selenium script Example with a pre-installed app Complete example targeting an Android platform
  • 26. PRO TIPS FOR MOBILE TEST AUTOMATION For a more professional test script 1 2 3 4 Execute tests with fresh and pre installed app Create a test suite with user focus Test on other networks(Wi-Fi, 3G…) Test non-function req.
  • 27. Thank you! Code for the all apps (back-end, front-end and tests) https://github.com/eliasnogueira/test-automation-javaone-2017