SlideShare a Scribd company logo
Test Data Preparation: Tips and Tricks
Sargis Sargsyan
Sr. Automation QA Engineer at Workfront
SQA Days 2017
2
TABLE OF CONTENTS - OUR AGENDA
What is Test Data?
Why is it
Important?
1
What is Test Data
Generation?
2
Why should test
data be created
before test
execution?
3
Object class
generation based
on JSON
4
Maintaining
responses of HTTP
requests using
Jackson library
5
How to store login
info in browser to
avoid logging in
from UI
6
Q&A
7
Test Data
Preparation via
HTTP requests
4
SQA Days 2017
3
WHAT IS TEST DATA?WHY IS IT IMPORTANT?
1. A single Selenium test should test one and only thing. A bug in another part of the application
that is not exactly related to the test should not cause the test to fail.
2. Every test should be independent. The test outcome should not affected by another test in the
suite.
3. Make a faster tests. As quicker test suite as much useful it is.
4. Every test should create and clean the data before and the after the test run.
5. We should not do the same action from the UI for every test case (e.g. login action)
When we are talking about best practice in Seleniumtest,
some of things often come up are:
SQA Days 2017
4
WHAT IS TEST DATA?WHY IS IT IMPORTANT?
Each test run does the following
Run the testTest initialize Test clean up
SQA Days 2017
5
WHAT IS TEST DATA GENERATION?
Test Data Generators based on their approaches are typically classified into
Random Test Data Generators
Goal OrientedGenerators Intelligent Test Data Generators
Pathwise Data Generators
TD
SQA Days 2017
6
WHY SHOULD TEST DATA BE CREATED BEFORE TEST EXECUTION?
!
!
Login 
Submissions 
 Pages	Navigation

TD
The reason for this is that
Selenium tests often involve
setups that may include
Only after doing those things
you are ready to assert
on some aspect of the website
 Actions
Sign	up   Interactions
Test Data Preparation via HTTP requests
SQA Days 2017
8
BASIC IDEA BEHIND COMBINING THESE TOOLS
These are thesteps how to get started with OKHttpand Test Data Preparation
FIRST STEP
We will be creating
instances of HTTP
for various methods
like GET,PUT,POST
etc. by mentioning
the request URL
SECOND STEP
We will be
composing the
request body as
JSON
THIRD STEP
Execute the desired
HTTP method when
headers etc are all
set
FOURTH STEP
Capture the
response and
convert it to a JSON
object.
FIFTH STEP
Desterialize JSON to
any Java Object
SQA Days 2017
9
OKHTTP - WILL DO REST FOR YOU
SQA Days 2017
10
POSTMAN - BEST FRIEND OF YOU
SQA Days 2017
11
OKHTTP - BASIC EXAMPLE FOR GET
SQA Days 2017
12
OKHTTP - BASIC EXAMPLE FOR POST
SQA Days 2017
13
GENERATE JAVA OBJECT CLASS BASED ON JSON
SQA Days 2017
14
GENERATE JAVA OBJECT CLASS BASED ON JSON
SQA Days 2017
15
JACKSON- CONVERT JAVA OBJECT TO / FROM JSON
15
Let’s see how to use Jackson 2.x to convert Java object to / from JSON.
Convert Java object to
JSON

Convert JSON to Java
object

SQA Days 2017
16
JACKSON - CONVERT JAVA OBJECT TO JSON
16

SQA Days 2017
17
JACKSON - JSON FROM STRING TO OBJECT
17

SQA Days 2017
18
JACKSON - RETRIEVE OBJECT VIA API
18
Skipping login fromUI
SQA Days 2017
20
AVOID CONSTANTLY TESTING LOGIN PAGE
These 3 steps to skip testing Login continuously
send an HTTP request to log
in
set the session cookie value
Navigate to a app specific
page

Login Succeed
SQA Days 2017
21
GENERATE SESSION ID VIA API
SQA Days 2017
22
GENERATE SESSION ID VIA API
SQA Days 2017
23
A SINGLE TEST WILL LOOK LIKE
SQA Days 2017
24
SINGLE TEST RUN
BestPracticevs. BadPractice
SQA Days 2017
26
BEST PRACTICE VS. BAD PRACTICE
Use PageObjects
pattern
"
SQA Days 2017
27
BEST PRACTICE VS. BAD PRACTICE
XPATH is the best
selector to use
#
Preferred selector order : id> name > css > xpath
SQA Days 2017
28
BEST PRACTICE VS. BAD PRACTICE
Automate
CAPTCHAS
#
CAPTCHAs canbebypassed using twostrategies:
• The firstidea isto disableCAPTCHAsinyour test environment.
• The second idea is toadd a hook to allowtests to bypassthe CAPTCHA.
SQA Days 2017
29
BEST PRACTICE VS. BAD PRACTICE
Create Specific
Application User per
Test
"
SQA Days 2017
30
BEST PRACTICE VS. BAD PRACTICE
Suite Retries
#"
SQA Days 2017
31
BEST PRACTICE VS. BAD PRACTICE
Gmail and Facbook
Logins
#
WebDriver is not the ideal choicetoautomate loginintowebsites likeGmail andFacebook,
firstlybecause it isagainsttheir policy and secondly because it isslow and unreliable.
The most appropriatechoicewould be to usethe API that these websites provide.
SQA Days 2017
32
BEST PRACTICE VS. BAD PRACTICE
Performance Testing
Using WebDriver
#
Using selenium WebDriver is not anideal choice for performance testing, not
because it can’tdoit but becauseit is not meant for thisjob ultimatelytester
might not get good results.
SQA Days 2017
33
BEST PRACTICE VS. BAD PRACTICE
Make Tests
Independent Of Each
Other
"
SQA Days 2017
34
BEST PRACTICE VS. BAD PRACTICE
Avoid Thread.sleep
prefer Wait or
FluentWait
"
QUESTIONS?
Go Ahead, Don’t Hesitate!
?
THANK YOU!
Have a Nice Day!


@sargisqa

/sargissargsyansargis.sargsyan@live.com

More Related Content

What's hot

Hugs instead of Bugs: Dreaming of Quality Tools for Devs and Testers
Hugs instead of Bugs: Dreaming of Quality Tools for Devs and TestersHugs instead of Bugs: Dreaming of Quality Tools for Devs and Testers
Hugs instead of Bugs: Dreaming of Quality Tools for Devs and Testers
Andreas Grabner
 
Building Reactive, Realtime Apps Without Writing Javascript
Building Reactive, Realtime Apps Without Writing JavascriptBuilding Reactive, Realtime Apps Without Writing Javascript
Building Reactive, Realtime Apps Without Writing Javascript
All Things Open
 
Web and App Performance: Top Problems to avoid to keep you out of the News
Web and App Performance: Top Problems to avoid to keep you out of the NewsWeb and App Performance: Top Problems to avoid to keep you out of the News
Web and App Performance: Top Problems to avoid to keep you out of the News
Andreas Grabner
 
BDD in Java using Cucumber
BDD in Java using CucumberBDD in Java using Cucumber
BDD in Java using Cucumber
slavkurochkin
 
Introduction to Test Driven Development
Introduction to Test Driven DevelopmentIntroduction to Test Driven Development
Introduction to Test Driven Development
Sarah Dutkiewicz
 
Four Practices to Fix Your Top .NET Performance Problems
Four Practices to Fix Your Top .NET Performance ProblemsFour Practices to Fix Your Top .NET Performance Problems
Four Practices to Fix Your Top .NET Performance Problems
Andreas Grabner
 
Load testing with Visual Studio and Azure - Andrew Siemer
Load testing with Visual Studio and Azure - Andrew SiemerLoad testing with Visual Studio and Azure - Andrew Siemer
Load testing with Visual Studio and Azure - Andrew Siemer
Andrew Siemer
 
W3C Web Performance - A detailed overview
W3C Web Performance - A detailed overviewW3C Web Performance - A detailed overview
W3C Web Performance - A detailed overview
Alois Reitbauer
 
Database DevOps Anti-patterns
Database DevOps Anti-patternsDatabase DevOps Anti-patterns
Database DevOps Anti-patterns
Alex Yates
 
Top .NET, Java & Web Performance Mistakes - Meetup Jan 2015
Top .NET, Java & Web Performance Mistakes - Meetup Jan 2015Top .NET, Java & Web Performance Mistakes - Meetup Jan 2015
Top .NET, Java & Web Performance Mistakes - Meetup Jan 2015
Andreas Grabner
 
How to keep you out of the News: Web and End-to-End Performance Tips
How to keep you out of the News: Web and End-to-End Performance TipsHow to keep you out of the News: Web and End-to-End Performance Tips
How to keep you out of the News: Web and End-to-End Performance Tips
Andreas Grabner
 
Testing Any Site With Cucumber and Selenium
Testing Any Site With Cucumber and SeleniumTesting Any Site With Cucumber and Selenium
Testing Any Site With Cucumber and Selenium
Chris Johnson
 
Getting CI right for SQL Server
Getting CI right for SQL ServerGetting CI right for SQL Server
Getting CI right for SQL Server
Alex Yates
 
Discovering Hot Topics in the Blogosphere
Discovering Hot Topics in the BlogosphereDiscovering Hot Topics in the Blogosphere
Discovering Hot Topics in the Blogosphere
Manolis Platakis
 
DevOps 101 for data professionals
DevOps 101 for data professionalsDevOps 101 for data professionals
DevOps 101 for data professionals
Alex Yates
 
Deploy Faster Without Failing Faster - Metrics-Driven - Dynatrace User Groups...
Deploy Faster Without Failing Faster - Metrics-Driven - Dynatrace User Groups...Deploy Faster Without Failing Faster - Metrics-Driven - Dynatrace User Groups...
Deploy Faster Without Failing Faster - Metrics-Driven - Dynatrace User Groups...
Andreas Grabner
 
HSPS 2015 - SharePoint Performance Santiy Checks
HSPS 2015 - SharePoint Performance Santiy ChecksHSPS 2015 - SharePoint Performance Santiy Checks
HSPS 2015 - SharePoint Performance Santiy Checks
Andreas Grabner
 
Lets cook cucumber !!
Lets cook cucumber !!Lets cook cucumber !!
Lets cook cucumber !!
vodQA
 
Engineering Velocity @indeed eng presented on Sept 24 2014 at Beyond Agile
Engineering Velocity @indeed eng presented on Sept 24 2014 at Beyond AgileEngineering Velocity @indeed eng presented on Sept 24 2014 at Beyond Agile
Engineering Velocity @indeed eng presented on Sept 24 2014 at Beyond Agile
KenAtIndeed
 
Going Offline with Salesforce1 Mobile SDK
Going Offline with Salesforce1 Mobile SDKGoing Offline with Salesforce1 Mobile SDK
Going Offline with Salesforce1 Mobile SDK
WinWire Technologies Inc
 

What's hot (20)

Hugs instead of Bugs: Dreaming of Quality Tools for Devs and Testers
Hugs instead of Bugs: Dreaming of Quality Tools for Devs and TestersHugs instead of Bugs: Dreaming of Quality Tools for Devs and Testers
Hugs instead of Bugs: Dreaming of Quality Tools for Devs and Testers
 
Building Reactive, Realtime Apps Without Writing Javascript
Building Reactive, Realtime Apps Without Writing JavascriptBuilding Reactive, Realtime Apps Without Writing Javascript
Building Reactive, Realtime Apps Without Writing Javascript
 
Web and App Performance: Top Problems to avoid to keep you out of the News
Web and App Performance: Top Problems to avoid to keep you out of the NewsWeb and App Performance: Top Problems to avoid to keep you out of the News
Web and App Performance: Top Problems to avoid to keep you out of the News
 
BDD in Java using Cucumber
BDD in Java using CucumberBDD in Java using Cucumber
BDD in Java using Cucumber
 
Introduction to Test Driven Development
Introduction to Test Driven DevelopmentIntroduction to Test Driven Development
Introduction to Test Driven Development
 
Four Practices to Fix Your Top .NET Performance Problems
Four Practices to Fix Your Top .NET Performance ProblemsFour Practices to Fix Your Top .NET Performance Problems
Four Practices to Fix Your Top .NET Performance Problems
 
Load testing with Visual Studio and Azure - Andrew Siemer
Load testing with Visual Studio and Azure - Andrew SiemerLoad testing with Visual Studio and Azure - Andrew Siemer
Load testing with Visual Studio and Azure - Andrew Siemer
 
W3C Web Performance - A detailed overview
W3C Web Performance - A detailed overviewW3C Web Performance - A detailed overview
W3C Web Performance - A detailed overview
 
Database DevOps Anti-patterns
Database DevOps Anti-patternsDatabase DevOps Anti-patterns
Database DevOps Anti-patterns
 
Top .NET, Java & Web Performance Mistakes - Meetup Jan 2015
Top .NET, Java & Web Performance Mistakes - Meetup Jan 2015Top .NET, Java & Web Performance Mistakes - Meetup Jan 2015
Top .NET, Java & Web Performance Mistakes - Meetup Jan 2015
 
How to keep you out of the News: Web and End-to-End Performance Tips
How to keep you out of the News: Web and End-to-End Performance TipsHow to keep you out of the News: Web and End-to-End Performance Tips
How to keep you out of the News: Web and End-to-End Performance Tips
 
Testing Any Site With Cucumber and Selenium
Testing Any Site With Cucumber and SeleniumTesting Any Site With Cucumber and Selenium
Testing Any Site With Cucumber and Selenium
 
Getting CI right for SQL Server
Getting CI right for SQL ServerGetting CI right for SQL Server
Getting CI right for SQL Server
 
Discovering Hot Topics in the Blogosphere
Discovering Hot Topics in the BlogosphereDiscovering Hot Topics in the Blogosphere
Discovering Hot Topics in the Blogosphere
 
DevOps 101 for data professionals
DevOps 101 for data professionalsDevOps 101 for data professionals
DevOps 101 for data professionals
 
Deploy Faster Without Failing Faster - Metrics-Driven - Dynatrace User Groups...
Deploy Faster Without Failing Faster - Metrics-Driven - Dynatrace User Groups...Deploy Faster Without Failing Faster - Metrics-Driven - Dynatrace User Groups...
Deploy Faster Without Failing Faster - Metrics-Driven - Dynatrace User Groups...
 
HSPS 2015 - SharePoint Performance Santiy Checks
HSPS 2015 - SharePoint Performance Santiy ChecksHSPS 2015 - SharePoint Performance Santiy Checks
HSPS 2015 - SharePoint Performance Santiy Checks
 
Lets cook cucumber !!
Lets cook cucumber !!Lets cook cucumber !!
Lets cook cucumber !!
 
Engineering Velocity @indeed eng presented on Sept 24 2014 at Beyond Agile
Engineering Velocity @indeed eng presented on Sept 24 2014 at Beyond AgileEngineering Velocity @indeed eng presented on Sept 24 2014 at Beyond Agile
Engineering Velocity @indeed eng presented on Sept 24 2014 at Beyond Agile
 
Going Offline with Salesforce1 Mobile SDK
Going Offline with Salesforce1 Mobile SDKGoing Offline with Salesforce1 Mobile SDK
Going Offline with Salesforce1 Mobile SDK
 

Similar to Test Data Preparation: Tips and Tricks - SQA Days 22 - Saint Petersburg

Optimizing React at Postmates
Optimizing React at PostmatesOptimizing React at Postmates
Optimizing React at Postmates
Trey Huffine
 
qTest 7.4: New Features
qTest 7.4: New FeaturesqTest 7.4: New Features
qTest 7.4: New Features
QASymphony
 
Content migration for sitecore
Content migration for sitecoreContent migration for sitecore
Content migration for sitecore
Surendra Sharma
 
Accelerating Your Test Execution Pipeline
Accelerating Your Test Execution PipelineAccelerating Your Test Execution Pipeline
Accelerating Your Test Execution Pipeline
SmartBear
 
So Your Boss Wants You to Performance Test Blackboard
So Your Boss Wants You to Performance Test BlackboardSo Your Boss Wants You to Performance Test Blackboard
So Your Boss Wants You to Performance Test Blackboard
Steve Feldman
 
Make Your Selenium Suite Faster and Reliable: Test Setup with REST APIs - SQA...
Make Your Selenium Suite Faster and Reliable: Test Setup with REST APIs - SQA...Make Your Selenium Suite Faster and Reliable: Test Setup with REST APIs - SQA...
Make Your Selenium Suite Faster and Reliable: Test Setup with REST APIs - SQA...
Sargis Sargsyan
 
ASP.NET 5 & Unit Testing
ASP.NET 5 & Unit TestingASP.NET 5 & Unit Testing
ASP.NET 5 & Unit Testing
Shahed Chowdhuri
 
ATAGTR2017 CDC Tests - Integration Tests cant be made simpler than this!
ATAGTR2017 CDC Tests - Integration Tests cant be made simpler than this!ATAGTR2017 CDC Tests - Integration Tests cant be made simpler than this!
ATAGTR2017 CDC Tests - Integration Tests cant be made simpler than this!
Agile Testing Alliance
 
Job portal
Job portalJob portal
Job portal
LoveBug Shashank
 
Test Framework for Acne Selenium+Sahi
Test Framework for Acne Selenium+SahiTest Framework for Acne Selenium+Sahi
Test Framework for Acne Selenium+Sahi
Shashikant Jagtap
 
Developer Night Opticon 2017
Developer Night Opticon 2017Developer Night Opticon 2017
Developer Night Opticon 2017
Optimizely
 
Atlassian's Mystique CLI, Minimizing the Experiment Development Cycle
Atlassian's Mystique CLI, Minimizing the Experiment Development CycleAtlassian's Mystique CLI, Minimizing the Experiment Development Cycle
Atlassian's Mystique CLI, Minimizing the Experiment Development Cycle
Optimizely
 
Job portal at jiit 2013-14
Job portal at jiit 2013-14Job portal at jiit 2013-14
Job portal at jiit 2013-14
kbabhishek4
 
WinOps Conf 2016 - Michael Greene - Release Pipelines
WinOps Conf 2016 - Michael Greene - Release PipelinesWinOps Conf 2016 - Michael Greene - Release Pipelines
WinOps Conf 2016 - Michael Greene - Release Pipelines
WinOps Conf
 
Helpful Automation Techniques - Selenium Camp 2014
Helpful Automation Techniques - Selenium Camp 2014Helpful Automation Techniques - Selenium Camp 2014
Helpful Automation Techniques - Selenium Camp 2014
Justin Ison
 
QA Fes 2016. Jacek Okrojek. Website performance from user perspective
QA Fes 2016. Jacek Okrojek. Website performance from user perspectiveQA Fes 2016. Jacek Okrojek. Website performance from user perspective
QA Fes 2016. Jacek Okrojek. Website performance from user perspective
QAFest
 
QTP ONLINE TRAINING
QTP ONLINE TRAININGQTP ONLINE TRAINING
QTP ONLINE TRAINING
Santhosh Sap
 
Ashish Baraiya
Ashish BaraiyaAshish Baraiya
Ashish Baraiya
Ashish Baraiya
 
Shuvam dutta | Performance testing & engineering
Shuvam dutta | Performance testing & engineeringShuvam dutta | Performance testing & engineering
Shuvam dutta | Performance testing & engineering
Shuvam Dutta
 
Continuous Testing
Continuous TestingContinuous Testing
Continuous Testing
Karim Fanadka
 

Similar to Test Data Preparation: Tips and Tricks - SQA Days 22 - Saint Petersburg (20)

Optimizing React at Postmates
Optimizing React at PostmatesOptimizing React at Postmates
Optimizing React at Postmates
 
qTest 7.4: New Features
qTest 7.4: New FeaturesqTest 7.4: New Features
qTest 7.4: New Features
 
Content migration for sitecore
Content migration for sitecoreContent migration for sitecore
Content migration for sitecore
 
Accelerating Your Test Execution Pipeline
Accelerating Your Test Execution PipelineAccelerating Your Test Execution Pipeline
Accelerating Your Test Execution Pipeline
 
So Your Boss Wants You to Performance Test Blackboard
So Your Boss Wants You to Performance Test BlackboardSo Your Boss Wants You to Performance Test Blackboard
So Your Boss Wants You to Performance Test Blackboard
 
Make Your Selenium Suite Faster and Reliable: Test Setup with REST APIs - SQA...
Make Your Selenium Suite Faster and Reliable: Test Setup with REST APIs - SQA...Make Your Selenium Suite Faster and Reliable: Test Setup with REST APIs - SQA...
Make Your Selenium Suite Faster and Reliable: Test Setup with REST APIs - SQA...
 
ASP.NET 5 & Unit Testing
ASP.NET 5 & Unit TestingASP.NET 5 & Unit Testing
ASP.NET 5 & Unit Testing
 
ATAGTR2017 CDC Tests - Integration Tests cant be made simpler than this!
ATAGTR2017 CDC Tests - Integration Tests cant be made simpler than this!ATAGTR2017 CDC Tests - Integration Tests cant be made simpler than this!
ATAGTR2017 CDC Tests - Integration Tests cant be made simpler than this!
 
Job portal
Job portalJob portal
Job portal
 
Test Framework for Acne Selenium+Sahi
Test Framework for Acne Selenium+SahiTest Framework for Acne Selenium+Sahi
Test Framework for Acne Selenium+Sahi
 
Developer Night Opticon 2017
Developer Night Opticon 2017Developer Night Opticon 2017
Developer Night Opticon 2017
 
Atlassian's Mystique CLI, Minimizing the Experiment Development Cycle
Atlassian's Mystique CLI, Minimizing the Experiment Development CycleAtlassian's Mystique CLI, Minimizing the Experiment Development Cycle
Atlassian's Mystique CLI, Minimizing the Experiment Development Cycle
 
Job portal at jiit 2013-14
Job portal at jiit 2013-14Job portal at jiit 2013-14
Job portal at jiit 2013-14
 
WinOps Conf 2016 - Michael Greene - Release Pipelines
WinOps Conf 2016 - Michael Greene - Release PipelinesWinOps Conf 2016 - Michael Greene - Release Pipelines
WinOps Conf 2016 - Michael Greene - Release Pipelines
 
Helpful Automation Techniques - Selenium Camp 2014
Helpful Automation Techniques - Selenium Camp 2014Helpful Automation Techniques - Selenium Camp 2014
Helpful Automation Techniques - Selenium Camp 2014
 
QA Fes 2016. Jacek Okrojek. Website performance from user perspective
QA Fes 2016. Jacek Okrojek. Website performance from user perspectiveQA Fes 2016. Jacek Okrojek. Website performance from user perspective
QA Fes 2016. Jacek Okrojek. Website performance from user perspective
 
QTP ONLINE TRAINING
QTP ONLINE TRAININGQTP ONLINE TRAINING
QTP ONLINE TRAINING
 
Ashish Baraiya
Ashish BaraiyaAshish Baraiya
Ashish Baraiya
 
Shuvam dutta | Performance testing & engineering
Shuvam dutta | Performance testing & engineeringShuvam dutta | Performance testing & engineering
Shuvam dutta | Performance testing & engineering
 
Continuous Testing
Continuous TestingContinuous Testing
Continuous Testing
 

More from Sargis Sargsyan

Let’s Talk About Quality Engineering
Let’s Talk About Quality EngineeringLet’s Talk About Quality Engineering
Let’s Talk About Quality Engineering
Sargis Sargsyan
 
Your Road to Quality Assurance
Your Road to Quality AssuranceYour Road to Quality Assurance
Your Road to Quality Assurance
Sargis Sargsyan
 
Appium Dockerization: from Scratch to Advanced Implementation - HUSTEF 2019
Appium Dockerization: from Scratch to Advanced Implementation - HUSTEF 2019Appium Dockerization: from Scratch to Advanced Implementation - HUSTEF 2019
Appium Dockerization: from Scratch to Advanced Implementation - HUSTEF 2019
Sargis Sargsyan
 
Getting Started with Dockerization of Selenium Tests Execution - Testwarez 2019
Getting Started with Dockerization of Selenium Tests Execution - Testwarez 2019Getting Started with Dockerization of Selenium Tests Execution - Testwarez 2019
Getting Started with Dockerization of Selenium Tests Execution - Testwarez 2019
Sargis Sargsyan
 
Run your Appium tests using Docker Android - AppiumConf 2019
Run your Appium tests using Docker Android - AppiumConf 2019Run your Appium tests using Docker Android - AppiumConf 2019
Run your Appium tests using Docker Android - AppiumConf 2019
Sargis Sargsyan
 
How to Dockerize Parallel Execution of Selenium Tests - SQA Days EU, Rgia, La...
How to Dockerize Parallel Execution of Selenium Tests - SQA Days EU, Rgia, La...How to Dockerize Parallel Execution of Selenium Tests - SQA Days EU, Rgia, La...
How to Dockerize Parallel Execution of Selenium Tests - SQA Days EU, Rgia, La...
Sargis Sargsyan
 
Easy Setup for Parallel Test Execution with Selenium Docker
Easy Setup for Parallel Test Execution with Selenium DockerEasy Setup for Parallel Test Execution with Selenium Docker
Easy Setup for Parallel Test Execution with Selenium Docker
Sargis Sargsyan
 
Better Page Object Handling with Loadable Component Pattern - SQA Days 20, Be...
Better Page Object Handling with Loadable Component Pattern - SQA Days 20, Be...Better Page Object Handling with Loadable Component Pattern - SQA Days 20, Be...
Better Page Object Handling with Loadable Component Pattern - SQA Days 20, Be...
Sargis Sargsyan
 
Better Page Object Handling with Loadable Component Pattern
Better Page Object Handling with Loadable Component PatternBetter Page Object Handling with Loadable Component Pattern
Better Page Object Handling with Loadable Component Pattern
Sargis Sargsyan
 
Agile Testing
Agile TestingAgile Testing
Agile Testing
Sargis Sargsyan
 
Selenium Testing on Chrome - Google DevFest Armenia 2015
Selenium Testing on Chrome - Google DevFest Armenia 2015Selenium Testing on Chrome - Google DevFest Armenia 2015
Selenium Testing on Chrome - Google DevFest Armenia 2015
Sargis Sargsyan
 
Web Application Testing with Selenium
Web Application Testing with Selenium Web Application Testing with Selenium
Web Application Testing with Selenium
Sargis Sargsyan
 
QA MeetUp Yerevan - Aug 25
QA MeetUp Yerevan - Aug 25QA MeetUp Yerevan - Aug 25
QA MeetUp Yerevan - Aug 25
Sargis Sargsyan
 

More from Sargis Sargsyan (13)

Let’s Talk About Quality Engineering
Let’s Talk About Quality EngineeringLet’s Talk About Quality Engineering
Let’s Talk About Quality Engineering
 
Your Road to Quality Assurance
Your Road to Quality AssuranceYour Road to Quality Assurance
Your Road to Quality Assurance
 
Appium Dockerization: from Scratch to Advanced Implementation - HUSTEF 2019
Appium Dockerization: from Scratch to Advanced Implementation - HUSTEF 2019Appium Dockerization: from Scratch to Advanced Implementation - HUSTEF 2019
Appium Dockerization: from Scratch to Advanced Implementation - HUSTEF 2019
 
Getting Started with Dockerization of Selenium Tests Execution - Testwarez 2019
Getting Started with Dockerization of Selenium Tests Execution - Testwarez 2019Getting Started with Dockerization of Selenium Tests Execution - Testwarez 2019
Getting Started with Dockerization of Selenium Tests Execution - Testwarez 2019
 
Run your Appium tests using Docker Android - AppiumConf 2019
Run your Appium tests using Docker Android - AppiumConf 2019Run your Appium tests using Docker Android - AppiumConf 2019
Run your Appium tests using Docker Android - AppiumConf 2019
 
How to Dockerize Parallel Execution of Selenium Tests - SQA Days EU, Rgia, La...
How to Dockerize Parallel Execution of Selenium Tests - SQA Days EU, Rgia, La...How to Dockerize Parallel Execution of Selenium Tests - SQA Days EU, Rgia, La...
How to Dockerize Parallel Execution of Selenium Tests - SQA Days EU, Rgia, La...
 
Easy Setup for Parallel Test Execution with Selenium Docker
Easy Setup for Parallel Test Execution with Selenium DockerEasy Setup for Parallel Test Execution with Selenium Docker
Easy Setup for Parallel Test Execution with Selenium Docker
 
Better Page Object Handling with Loadable Component Pattern - SQA Days 20, Be...
Better Page Object Handling with Loadable Component Pattern - SQA Days 20, Be...Better Page Object Handling with Loadable Component Pattern - SQA Days 20, Be...
Better Page Object Handling with Loadable Component Pattern - SQA Days 20, Be...
 
Better Page Object Handling with Loadable Component Pattern
Better Page Object Handling with Loadable Component PatternBetter Page Object Handling with Loadable Component Pattern
Better Page Object Handling with Loadable Component Pattern
 
Agile Testing
Agile TestingAgile Testing
Agile Testing
 
Selenium Testing on Chrome - Google DevFest Armenia 2015
Selenium Testing on Chrome - Google DevFest Armenia 2015Selenium Testing on Chrome - Google DevFest Armenia 2015
Selenium Testing on Chrome - Google DevFest Armenia 2015
 
Web Application Testing with Selenium
Web Application Testing with Selenium Web Application Testing with Selenium
Web Application Testing with Selenium
 
QA MeetUp Yerevan - Aug 25
QA MeetUp Yerevan - Aug 25QA MeetUp Yerevan - Aug 25
QA MeetUp Yerevan - Aug 25
 

Recently uploaded

Oracle 23c New Features For DBAs and Developers.pptx
Oracle 23c New Features For DBAs and Developers.pptxOracle 23c New Features For DBAs and Developers.pptx
Oracle 23c New Features For DBAs and Developers.pptx
Remote DBA Services
 
Oracle Database 19c New Features for DBAs and Developers.pptx
Oracle Database 19c New Features for DBAs and Developers.pptxOracle Database 19c New Features for DBAs and Developers.pptx
Oracle Database 19c New Features for DBAs and Developers.pptx
Remote DBA Services
 
DevOps Consulting Company | Hire DevOps Services
DevOps Consulting Company | Hire DevOps ServicesDevOps Consulting Company | Hire DevOps Services
DevOps Consulting Company | Hire DevOps Services
seospiralmantra
 
Unveiling the Advantages of Agile Software Development.pdf
Unveiling the Advantages of Agile Software Development.pdfUnveiling the Advantages of Agile Software Development.pdf
Unveiling the Advantages of Agile Software Development.pdf
brainerhub1
 
Operational ease MuleSoft and Salesforce Service Cloud Solution v1.0.pptx
Operational ease MuleSoft and Salesforce Service Cloud Solution v1.0.pptxOperational ease MuleSoft and Salesforce Service Cloud Solution v1.0.pptx
Operational ease MuleSoft and Salesforce Service Cloud Solution v1.0.pptx
sandeepmenon62
 
Preparing Non - Technical Founders for Engaging a Tech Agency
Preparing Non - Technical Founders for Engaging  a  Tech AgencyPreparing Non - Technical Founders for Engaging  a  Tech Agency
Preparing Non - Technical Founders for Engaging a Tech Agency
ISH Technologies
 
Superpower Your Apache Kafka Applications Development with Complementary Open...
Superpower Your Apache Kafka Applications Development with Complementary Open...Superpower Your Apache Kafka Applications Development with Complementary Open...
Superpower Your Apache Kafka Applications Development with Complementary Open...
Paul Brebner
 
ppt on the brain chip neuralink.pptx
ppt  on   the brain  chip neuralink.pptxppt  on   the brain  chip neuralink.pptx
ppt on the brain chip neuralink.pptx
Reetu63
 
KuberTENes Birthday Bash Guadalajara - Introducción a Argo CD
KuberTENes Birthday Bash Guadalajara - Introducción a Argo CDKuberTENes Birthday Bash Guadalajara - Introducción a Argo CD
KuberTENes Birthday Bash Guadalajara - Introducción a Argo CD
rodomar2
 
The Rising Future of CPaaS in the Middle East 2024
The Rising Future of CPaaS in the Middle East 2024The Rising Future of CPaaS in the Middle East 2024
The Rising Future of CPaaS in the Middle East 2024
Yara Milbes
 
一比一原版(sdsu毕业证书)圣地亚哥州立大学毕业证如何办理
一比一原版(sdsu毕业证书)圣地亚哥州立大学毕业证如何办理一比一原版(sdsu毕业证书)圣地亚哥州立大学毕业证如何办理
一比一原版(sdsu毕业证书)圣地亚哥州立大学毕业证如何办理
kgyxske
 
如何办理(hull学位证书)英国赫尔大学毕业证硕士文凭原版一模一样
如何办理(hull学位证书)英国赫尔大学毕业证硕士文凭原版一模一样如何办理(hull学位证书)英国赫尔大学毕业证硕士文凭原版一模一样
如何办理(hull学位证书)英国赫尔大学毕业证硕士文凭原版一模一样
gapen1
 
Kubernetes at Scale: Going Multi-Cluster with Istio
Kubernetes at Scale:  Going Multi-Cluster  with IstioKubernetes at Scale:  Going Multi-Cluster  with Istio
Kubernetes at Scale: Going Multi-Cluster with Istio
Severalnines
 
How Can Hiring A Mobile App Development Company Help Your Business Grow?
How Can Hiring A Mobile App Development Company Help Your Business Grow?How Can Hiring A Mobile App Development Company Help Your Business Grow?
How Can Hiring A Mobile App Development Company Help Your Business Grow?
ToXSL Technologies
 
Boost Your Savings with These Money Management Apps
Boost Your Savings with These Money Management AppsBoost Your Savings with These Money Management Apps
Boost Your Savings with These Money Management Apps
Jhone kinadey
 
UI5con 2024 - Boost Your Development Experience with UI5 Tooling Extensions
UI5con 2024 - Boost Your Development Experience with UI5 Tooling ExtensionsUI5con 2024 - Boost Your Development Experience with UI5 Tooling Extensions
UI5con 2024 - Boost Your Development Experience with UI5 Tooling Extensions
Peter Muessig
 
Measures in SQL (SIGMOD 2024, Santiago, Chile)
Measures in SQL (SIGMOD 2024, Santiago, Chile)Measures in SQL (SIGMOD 2024, Santiago, Chile)
Measures in SQL (SIGMOD 2024, Santiago, Chile)
Julian Hyde
 
WWDC 2024 Keynote Review: For CocoaCoders Austin
WWDC 2024 Keynote Review: For CocoaCoders AustinWWDC 2024 Keynote Review: For CocoaCoders Austin
WWDC 2024 Keynote Review: For CocoaCoders Austin
Patrick Weigel
 
Using Query Store in Azure PostgreSQL to Understand Query Performance
Using Query Store in Azure PostgreSQL to Understand Query PerformanceUsing Query Store in Azure PostgreSQL to Understand Query Performance
Using Query Store in Azure PostgreSQL to Understand Query Performance
Grant Fritchey
 
一比一原版(UMN毕业证)明尼苏达大学毕业证如何办理
一比一原版(UMN毕业证)明尼苏达大学毕业证如何办理一比一原版(UMN毕业证)明尼苏达大学毕业证如何办理
一比一原版(UMN毕业证)明尼苏达大学毕业证如何办理
dakas1
 

Recently uploaded (20)

Oracle 23c New Features For DBAs and Developers.pptx
Oracle 23c New Features For DBAs and Developers.pptxOracle 23c New Features For DBAs and Developers.pptx
Oracle 23c New Features For DBAs and Developers.pptx
 
Oracle Database 19c New Features for DBAs and Developers.pptx
Oracle Database 19c New Features for DBAs and Developers.pptxOracle Database 19c New Features for DBAs and Developers.pptx
Oracle Database 19c New Features for DBAs and Developers.pptx
 
DevOps Consulting Company | Hire DevOps Services
DevOps Consulting Company | Hire DevOps ServicesDevOps Consulting Company | Hire DevOps Services
DevOps Consulting Company | Hire DevOps Services
 
Unveiling the Advantages of Agile Software Development.pdf
Unveiling the Advantages of Agile Software Development.pdfUnveiling the Advantages of Agile Software Development.pdf
Unveiling the Advantages of Agile Software Development.pdf
 
Operational ease MuleSoft and Salesforce Service Cloud Solution v1.0.pptx
Operational ease MuleSoft and Salesforce Service Cloud Solution v1.0.pptxOperational ease MuleSoft and Salesforce Service Cloud Solution v1.0.pptx
Operational ease MuleSoft and Salesforce Service Cloud Solution v1.0.pptx
 
Preparing Non - Technical Founders for Engaging a Tech Agency
Preparing Non - Technical Founders for Engaging  a  Tech AgencyPreparing Non - Technical Founders for Engaging  a  Tech Agency
Preparing Non - Technical Founders for Engaging a Tech Agency
 
Superpower Your Apache Kafka Applications Development with Complementary Open...
Superpower Your Apache Kafka Applications Development with Complementary Open...Superpower Your Apache Kafka Applications Development with Complementary Open...
Superpower Your Apache Kafka Applications Development with Complementary Open...
 
ppt on the brain chip neuralink.pptx
ppt  on   the brain  chip neuralink.pptxppt  on   the brain  chip neuralink.pptx
ppt on the brain chip neuralink.pptx
 
KuberTENes Birthday Bash Guadalajara - Introducción a Argo CD
KuberTENes Birthday Bash Guadalajara - Introducción a Argo CDKuberTENes Birthday Bash Guadalajara - Introducción a Argo CD
KuberTENes Birthday Bash Guadalajara - Introducción a Argo CD
 
The Rising Future of CPaaS in the Middle East 2024
The Rising Future of CPaaS in the Middle East 2024The Rising Future of CPaaS in the Middle East 2024
The Rising Future of CPaaS in the Middle East 2024
 
一比一原版(sdsu毕业证书)圣地亚哥州立大学毕业证如何办理
一比一原版(sdsu毕业证书)圣地亚哥州立大学毕业证如何办理一比一原版(sdsu毕业证书)圣地亚哥州立大学毕业证如何办理
一比一原版(sdsu毕业证书)圣地亚哥州立大学毕业证如何办理
 
如何办理(hull学位证书)英国赫尔大学毕业证硕士文凭原版一模一样
如何办理(hull学位证书)英国赫尔大学毕业证硕士文凭原版一模一样如何办理(hull学位证书)英国赫尔大学毕业证硕士文凭原版一模一样
如何办理(hull学位证书)英国赫尔大学毕业证硕士文凭原版一模一样
 
Kubernetes at Scale: Going Multi-Cluster with Istio
Kubernetes at Scale:  Going Multi-Cluster  with IstioKubernetes at Scale:  Going Multi-Cluster  with Istio
Kubernetes at Scale: Going Multi-Cluster with Istio
 
How Can Hiring A Mobile App Development Company Help Your Business Grow?
How Can Hiring A Mobile App Development Company Help Your Business Grow?How Can Hiring A Mobile App Development Company Help Your Business Grow?
How Can Hiring A Mobile App Development Company Help Your Business Grow?
 
Boost Your Savings with These Money Management Apps
Boost Your Savings with These Money Management AppsBoost Your Savings with These Money Management Apps
Boost Your Savings with These Money Management Apps
 
UI5con 2024 - Boost Your Development Experience with UI5 Tooling Extensions
UI5con 2024 - Boost Your Development Experience with UI5 Tooling ExtensionsUI5con 2024 - Boost Your Development Experience with UI5 Tooling Extensions
UI5con 2024 - Boost Your Development Experience with UI5 Tooling Extensions
 
Measures in SQL (SIGMOD 2024, Santiago, Chile)
Measures in SQL (SIGMOD 2024, Santiago, Chile)Measures in SQL (SIGMOD 2024, Santiago, Chile)
Measures in SQL (SIGMOD 2024, Santiago, Chile)
 
WWDC 2024 Keynote Review: For CocoaCoders Austin
WWDC 2024 Keynote Review: For CocoaCoders AustinWWDC 2024 Keynote Review: For CocoaCoders Austin
WWDC 2024 Keynote Review: For CocoaCoders Austin
 
Using Query Store in Azure PostgreSQL to Understand Query Performance
Using Query Store in Azure PostgreSQL to Understand Query PerformanceUsing Query Store in Azure PostgreSQL to Understand Query Performance
Using Query Store in Azure PostgreSQL to Understand Query Performance
 
一比一原版(UMN毕业证)明尼苏达大学毕业证如何办理
一比一原版(UMN毕业证)明尼苏达大学毕业证如何办理一比一原版(UMN毕业证)明尼苏达大学毕业证如何办理
一比一原版(UMN毕业证)明尼苏达大学毕业证如何办理
 

Test Data Preparation: Tips and Tricks - SQA Days 22 - Saint Petersburg

  • 1. Test Data Preparation: Tips and Tricks Sargis Sargsyan Sr. Automation QA Engineer at Workfront
  • 2. SQA Days 2017 2 TABLE OF CONTENTS - OUR AGENDA What is Test Data? Why is it Important? 1 What is Test Data Generation? 2 Why should test data be created before test execution? 3 Object class generation based on JSON 4 Maintaining responses of HTTP requests using Jackson library 5 How to store login info in browser to avoid logging in from UI 6 Q&A 7 Test Data Preparation via HTTP requests 4
  • 3. SQA Days 2017 3 WHAT IS TEST DATA?WHY IS IT IMPORTANT? 1. A single Selenium test should test one and only thing. A bug in another part of the application that is not exactly related to the test should not cause the test to fail. 2. Every test should be independent. The test outcome should not affected by another test in the suite. 3. Make a faster tests. As quicker test suite as much useful it is. 4. Every test should create and clean the data before and the after the test run. 5. We should not do the same action from the UI for every test case (e.g. login action) When we are talking about best practice in Seleniumtest, some of things often come up are:
  • 4. SQA Days 2017 4 WHAT IS TEST DATA?WHY IS IT IMPORTANT? Each test run does the following Run the testTest initialize Test clean up
  • 5. SQA Days 2017 5 WHAT IS TEST DATA GENERATION? Test Data Generators based on their approaches are typically classified into Random Test Data Generators Goal OrientedGenerators Intelligent Test Data Generators Pathwise Data Generators TD
  • 6. SQA Days 2017 6 WHY SHOULD TEST DATA BE CREATED BEFORE TEST EXECUTION? ! ! Login  Submissions   Pages Navigation  TD The reason for this is that Selenium tests often involve setups that may include Only after doing those things you are ready to assert on some aspect of the website  Actions Sign up   Interactions
  • 7. Test Data Preparation via HTTP requests
  • 8. SQA Days 2017 8 BASIC IDEA BEHIND COMBINING THESE TOOLS These are thesteps how to get started with OKHttpand Test Data Preparation FIRST STEP We will be creating instances of HTTP for various methods like GET,PUT,POST etc. by mentioning the request URL SECOND STEP We will be composing the request body as JSON THIRD STEP Execute the desired HTTP method when headers etc are all set FOURTH STEP Capture the response and convert it to a JSON object. FIFTH STEP Desterialize JSON to any Java Object
  • 9. SQA Days 2017 9 OKHTTP - WILL DO REST FOR YOU
  • 10. SQA Days 2017 10 POSTMAN - BEST FRIEND OF YOU
  • 11. SQA Days 2017 11 OKHTTP - BASIC EXAMPLE FOR GET
  • 12. SQA Days 2017 12 OKHTTP - BASIC EXAMPLE FOR POST
  • 13. SQA Days 2017 13 GENERATE JAVA OBJECT CLASS BASED ON JSON
  • 14. SQA Days 2017 14 GENERATE JAVA OBJECT CLASS BASED ON JSON
  • 15. SQA Days 2017 15 JACKSON- CONVERT JAVA OBJECT TO / FROM JSON 15 Let’s see how to use Jackson 2.x to convert Java object to / from JSON. Convert Java object to JSON  Convert JSON to Java object 
  • 16. SQA Days 2017 16 JACKSON - CONVERT JAVA OBJECT TO JSON 16 
  • 17. SQA Days 2017 17 JACKSON - JSON FROM STRING TO OBJECT 17 
  • 18. SQA Days 2017 18 JACKSON - RETRIEVE OBJECT VIA API 18
  • 20. SQA Days 2017 20 AVOID CONSTANTLY TESTING LOGIN PAGE These 3 steps to skip testing Login continuously send an HTTP request to log in set the session cookie value Navigate to a app specific page  Login Succeed
  • 21. SQA Days 2017 21 GENERATE SESSION ID VIA API
  • 22. SQA Days 2017 22 GENERATE SESSION ID VIA API
  • 23. SQA Days 2017 23 A SINGLE TEST WILL LOOK LIKE
  • 26. SQA Days 2017 26 BEST PRACTICE VS. BAD PRACTICE Use PageObjects pattern "
  • 27. SQA Days 2017 27 BEST PRACTICE VS. BAD PRACTICE XPATH is the best selector to use # Preferred selector order : id> name > css > xpath
  • 28. SQA Days 2017 28 BEST PRACTICE VS. BAD PRACTICE Automate CAPTCHAS # CAPTCHAs canbebypassed using twostrategies: • The firstidea isto disableCAPTCHAsinyour test environment. • The second idea is toadd a hook to allowtests to bypassthe CAPTCHA.
  • 29. SQA Days 2017 29 BEST PRACTICE VS. BAD PRACTICE Create Specific Application User per Test "
  • 30. SQA Days 2017 30 BEST PRACTICE VS. BAD PRACTICE Suite Retries #"
  • 31. SQA Days 2017 31 BEST PRACTICE VS. BAD PRACTICE Gmail and Facbook Logins # WebDriver is not the ideal choicetoautomate loginintowebsites likeGmail andFacebook, firstlybecause it isagainsttheir policy and secondly because it isslow and unreliable. The most appropriatechoicewould be to usethe API that these websites provide.
  • 32. SQA Days 2017 32 BEST PRACTICE VS. BAD PRACTICE Performance Testing Using WebDriver # Using selenium WebDriver is not anideal choice for performance testing, not because it can’tdoit but becauseit is not meant for thisjob ultimatelytester might not get good results.
  • 33. SQA Days 2017 33 BEST PRACTICE VS. BAD PRACTICE Make Tests Independent Of Each Other "
  • 34. SQA Days 2017 34 BEST PRACTICE VS. BAD PRACTICE Avoid Thread.sleep prefer Wait or FluentWait "
  • 36. THANK YOU! Have a Nice Day!   @sargisqa  /sargissargsyansargis.sargsyan@live.com