SlideShare a Scribd company logo
1 of 36
Download to read offline
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.
When we are talking about best practice in Selenium test,
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 Oriented Generators 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 the steps how to get started with OKHttp and 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 from UI
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
Best Practice vs. Bad Practice
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 can be bypassed using two strategies:
• The first idea is to disable CAPTCHAs in your test environment.
• The second idea is to add a hook to allow tests to bypass the 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 choice to automate login into websites like Gmail and Facebook,
firstly because it is against their policy and secondly because it is slow and unreliable.
The most appropriate choice would be to use the API that these websites provide.
SQA Days 2017
32
BEST PRACTICE VS. BAD PRACTICE
Performance Testing
Using WebDriver
#
Using selenium WebDriver is not an ideal choice for performance testing, not
because it can’t do it but because it is not meant for this job ultimately tester 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

Discovering Hot Topics in the Blogosphere
Discovering Hot Topics in the BlogosphereDiscovering Hot Topics in the Blogosphere
Discovering Hot Topics in the BlogosphereManolis Platakis
 
Application Quality Gates in Continuous Delivery: Deliver Better Software Fas...
Application Quality Gates in Continuous Delivery: Deliver Better Software Fas...Application Quality Gates in Continuous Delivery: Deliver Better Software Fas...
Application Quality Gates in Continuous Delivery: Deliver Better Software Fas...Andreas Grabner
 
BTD2015 - Your Place In DevTOps is Finding Solutions - Not Just Bugs!
BTD2015 - Your Place In DevTOps is Finding Solutions - Not Just Bugs!BTD2015 - Your Place In DevTOps is Finding Solutions - Not Just Bugs!
BTD2015 - Your Place In DevTOps is Finding Solutions - Not Just Bugs!Andreas Grabner
 
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 NewsAndreas Grabner
 
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 ProblemsAndreas Grabner
 
Database DevOps Anti-patterns
Database DevOps Anti-patternsDatabase DevOps Anti-patterns
Database DevOps Anti-patternsAlex Yates
 
Datadog + VictorOps Webinar
Datadog + VictorOps WebinarDatadog + VictorOps Webinar
Datadog + VictorOps WebinarDatadog
 
Getting CI right for SQL Server
Getting CI right for SQL ServerGetting CI right for SQL Server
Getting CI right for SQL ServerAlex Yates
 
DevOps 101 for data professionals
DevOps 101 for data professionalsDevOps 101 for data professionals
DevOps 101 for data professionalsAlex Yates
 
Lets cook cucumber !!
Lets cook cucumber !!Lets cook cucumber !!
Lets cook cucumber !!vodQA
 
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 TipsAndreas Grabner
 
Introduction to Test Driven Development
Introduction to Test Driven DevelopmentIntroduction to Test Driven Development
Introduction to Test Driven DevelopmentSarah Dutkiewicz
 
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 2015Andreas Grabner
 
Boston DevOps Days 2016: Implementing Metrics Driven DevOps - Why and How
Boston DevOps Days 2016: Implementing Metrics Driven DevOps - Why and HowBoston DevOps Days 2016: Implementing Metrics Driven DevOps - Why and How
Boston DevOps Days 2016: Implementing Metrics Driven DevOps - Why and HowAndreas Grabner
 
Continues Deployment - Tech Talk week
Continues Deployment - Tech Talk weekContinues Deployment - Tech Talk week
Continues Deployment - Tech Talk weekrantav
 
Yelp Tech Talks: Mobile Testing 1, 2, 3
Yelp Tech Talks: Mobile Testing 1, 2, 3Yelp Tech Talks: Mobile Testing 1, 2, 3
Yelp Tech Talks: Mobile Testing 1, 2, 3Yelp Engineering
 

What's hot (20)

Discovering Hot Topics in the Blogosphere
Discovering Hot Topics in the BlogosphereDiscovering Hot Topics in the Blogosphere
Discovering Hot Topics in the Blogosphere
 
Application Quality Gates in Continuous Delivery: Deliver Better Software Fas...
Application Quality Gates in Continuous Delivery: Deliver Better Software Fas...Application Quality Gates in Continuous Delivery: Deliver Better Software Fas...
Application Quality Gates in Continuous Delivery: Deliver Better Software Fas...
 
BTD2015 - Your Place In DevTOps is Finding Solutions - Not Just Bugs!
BTD2015 - Your Place In DevTOps is Finding Solutions - Not Just Bugs!BTD2015 - Your Place In DevTOps is Finding Solutions - Not Just Bugs!
BTD2015 - Your Place In DevTOps is Finding Solutions - Not Just Bugs!
 
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
 
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
 
Automation solution
Automation solutionAutomation solution
Automation solution
 
Database DevOps Anti-patterns
Database DevOps Anti-patternsDatabase DevOps Anti-patterns
Database DevOps Anti-patterns
 
Datadog + VictorOps Webinar
Datadog + VictorOps WebinarDatadog + VictorOps Webinar
Datadog + VictorOps Webinar
 
Getting CI right for SQL Server
Getting CI right for SQL ServerGetting CI right for SQL Server
Getting CI right for SQL Server
 
DevOps 101 for data professionals
DevOps 101 for data professionalsDevOps 101 for data professionals
DevOps 101 for data professionals
 
Lets cook cucumber !!
Lets cook cucumber !!Lets cook cucumber !!
Lets cook cucumber !!
 
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
 
Introduction to Test Driven Development
Introduction to Test Driven DevelopmentIntroduction to Test Driven Development
Introduction to Test Driven Development
 
Humans by the hundred
Humans by the hundredHumans by the hundred
Humans by the hundred
 
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
 
Boston DevOps Days 2016: Implementing Metrics Driven DevOps - Why and How
Boston DevOps Days 2016: Implementing Metrics Driven DevOps - Why and HowBoston DevOps Days 2016: Implementing Metrics Driven DevOps - Why and How
Boston DevOps Days 2016: Implementing Metrics Driven DevOps - Why and How
 
Continues Deployment - Tech Talk week
Continues Deployment - Tech Talk weekContinues Deployment - Tech Talk week
Continues Deployment - Tech Talk week
 
Reactive streams
Reactive streamsReactive streams
Reactive streams
 
Yelp Tech Talks: Mobile Testing 1, 2, 3
Yelp Tech Talks: Mobile Testing 1, 2, 3Yelp Tech Talks: Mobile Testing 1, 2, 3
Yelp Tech Talks: Mobile Testing 1, 2, 3
 
Why Scrum
Why ScrumWhy Scrum
Why Scrum
 

Similar to Test Data Preparation: Tips and Tricks

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
 
Optimizing React at Postmates
Optimizing React at PostmatesOptimizing React at Postmates
Optimizing React at PostmatesTrey Huffine
 
Developer Night Opticon 2017
Developer Night Opticon 2017Developer Night Opticon 2017
Developer Night Opticon 2017Optimizely
 
Content migration for sitecore
Content migration for sitecoreContent migration for sitecore
Content migration for sitecoreSurendra Sharma
 
Modern software testing and processes 2019
Modern software testing and processes 2019Modern software testing and processes 2019
Modern software testing and processes 2019Karim Fanadka
 
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 CycleOptimizely
 
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 BlackboardSteve Feldman
 
[Srijan Wednesday Webinars] Choosing the Right Testing Framework
[Srijan Wednesday Webinars] Choosing the Right Testing Framework[Srijan Wednesday Webinars] Choosing the Right Testing Framework
[Srijan Wednesday Webinars] Choosing the Right Testing FrameworkSrijan Technologies
 
Asp.net Programmer Certification
Asp.net Programmer CertificationAsp.net Programmer Certification
Asp.net Programmer CertificationVskills
 
qTest 7.4: New Features
qTest 7.4: New FeaturesqTest 7.4: New Features
qTest 7.4: New FeaturesQASymphony
 
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 PipelinesWinOps Conf
 
Certified ASP.Net Programmer
Certified ASP.Net ProgrammerCertified ASP.Net Programmer
Certified ASP.Net ProgrammerNarender Rana
 
Integrate MongoDB & SQL data with a single REST API
Integrate MongoDB & SQL data with a single REST APIIntegrate MongoDB & SQL data with a single REST API
Integrate MongoDB & SQL data with a single REST APIEspresso Logic
 
Continuous Testing 2016
Continuous Testing 2016Continuous Testing 2016
Continuous Testing 2016Karim Fanadka
 
Ruby on Rails Performance Tuning. Make it faster, make it better (WindyCityRa...
Ruby on Rails Performance Tuning. Make it faster, make it better (WindyCityRa...Ruby on Rails Performance Tuning. Make it faster, make it better (WindyCityRa...
Ruby on Rails Performance Tuning. Make it faster, make it better (WindyCityRa...John McCaffrey
 
Windy cityrails performance_tuning
Windy cityrails performance_tuningWindy cityrails performance_tuning
Windy cityrails performance_tuningJohn McCaffrey
 
Using Compass to Diagnose Performance Problems
Using Compass to Diagnose Performance Problems Using Compass to Diagnose Performance Problems
Using Compass to Diagnose Performance Problems MongoDB
 
Using Compass to Diagnose Performance Problems in Your Cluster
Using Compass to Diagnose Performance Problems in Your ClusterUsing Compass to Diagnose Performance Problems in Your Cluster
Using Compass to Diagnose Performance Problems in Your ClusterMongoDB
 

Similar to Test Data Preparation: Tips and Tricks (20)

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!
 
Optimizing React at Postmates
Optimizing React at PostmatesOptimizing React at Postmates
Optimizing React at Postmates
 
Developer Night Opticon 2017
Developer Night Opticon 2017Developer Night Opticon 2017
Developer Night Opticon 2017
 
Content migration for sitecore
Content migration for sitecoreContent migration for sitecore
Content migration for sitecore
 
Modern software testing and processes 2019
Modern software testing and processes 2019Modern software testing and processes 2019
Modern software testing and processes 2019
 
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
 
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
 
[Srijan Wednesday Webinars] Choosing the Right Testing Framework
[Srijan Wednesday Webinars] Choosing the Right Testing Framework[Srijan Wednesday Webinars] Choosing the Right Testing Framework
[Srijan Wednesday Webinars] Choosing the Right Testing Framework
 
Asp.net Programmer Certification
Asp.net Programmer CertificationAsp.net Programmer Certification
Asp.net Programmer Certification
 
qTest 7.4: New Features
qTest 7.4: New FeaturesqTest 7.4: New Features
qTest 7.4: New Features
 
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
 
Certified ASP.Net Programmer
Certified ASP.Net ProgrammerCertified ASP.Net Programmer
Certified ASP.Net Programmer
 
Integrate MongoDB & SQL data with a single REST API
Integrate MongoDB & SQL data with a single REST APIIntegrate MongoDB & SQL data with a single REST API
Integrate MongoDB & SQL data with a single REST API
 
Test first
Test firstTest first
Test first
 
Continuous Testing
Continuous TestingContinuous Testing
Continuous Testing
 
Continuous Testing 2016
Continuous Testing 2016Continuous Testing 2016
Continuous Testing 2016
 
Ruby on Rails Performance Tuning. Make it faster, make it better (WindyCityRa...
Ruby on Rails Performance Tuning. Make it faster, make it better (WindyCityRa...Ruby on Rails Performance Tuning. Make it faster, make it better (WindyCityRa...
Ruby on Rails Performance Tuning. Make it faster, make it better (WindyCityRa...
 
Windy cityrails performance_tuning
Windy cityrails performance_tuningWindy cityrails performance_tuning
Windy cityrails performance_tuning
 
Using Compass to Diagnose Performance Problems
Using Compass to Diagnose Performance Problems Using Compass to Diagnose Performance Problems
Using Compass to Diagnose Performance Problems
 
Using Compass to Diagnose Performance Problems in Your Cluster
Using Compass to Diagnose Performance Problems in Your ClusterUsing Compass to Diagnose Performance Problems in Your Cluster
Using Compass to Diagnose Performance Problems in Your Cluster
 

More from SQALab

Готовим стажировку
Готовим стажировкуГотовим стажировку
Готовим стажировкуSQALab
 
Куда приводят мечты? или Искусство развития тестировщика
Куда приводят мечты? или Искусство развития тестировщикаКуда приводят мечты? или Искусство развития тестировщика
Куда приводят мечты? или Искусство развития тестировщикаSQALab
 
Оптимизация Selenium тестов и ускорение их поддержки
Оптимизация Selenium тестов и ускорение их поддержкиОптимизация Selenium тестов и ускорение их поддержки
Оптимизация Selenium тестов и ускорение их поддержкиSQALab
 
Автоматизация 0.0: 0 - бюджет, 0 - опыт программирования
Автоматизация 0.0: 0 - бюджет, 0 - опыт программированияАвтоматизация 0.0: 0 - бюджет, 0 - опыт программирования
Автоматизация 0.0: 0 - бюджет, 0 - опыт программированияSQALab
 
Нагрузочное тестирование нестандартных протоколов с использованием Citrix и J...
Нагрузочное тестирование нестандартных протоколов с использованием Citrix и J...Нагрузочное тестирование нестандартных протоколов с использованием Citrix и J...
Нагрузочное тестирование нестандартных протоколов с использованием Citrix и J...SQALab
 
Continuous performance testing
Continuous performance testingContinuous performance testing
Continuous performance testingSQALab
 
Конфиги вместо костылей. Pytestconfig и зачем он нужен
Конфиги вместо костылей. Pytestconfig и зачем он нуженКонфиги вместо костылей. Pytestconfig и зачем он нужен
Конфиги вместо костылей. Pytestconfig и зачем он нуженSQALab
 
Команда чемпионов в ИТ стихии
Команда чемпионов в ИТ стихииКоманда чемпионов в ИТ стихии
Команда чемпионов в ИТ стихииSQALab
 
API. Серебряная пуля в магазине советов
API. Серебряная пуля в магазине советовAPI. Серебряная пуля в магазине советов
API. Серебряная пуля в магазине советовSQALab
 
Добиваемся эффективности каждого из 9000+ UI-тестов
Добиваемся эффективности каждого из 9000+ UI-тестовДобиваемся эффективности каждого из 9000+ UI-тестов
Добиваемся эффективности каждого из 9000+ UI-тестовSQALab
 
Делаем автоматизацию проектных KPIs
Делаем автоматизацию проектных KPIsДелаем автоматизацию проектных KPIs
Делаем автоматизацию проектных KPIsSQALab
 
Вредные привычки в тест-менеджменте
Вредные привычки в тест-менеджментеВредные привычки в тест-менеджменте
Вредные привычки в тест-менеджментеSQALab
 
Мощь переполняет с JDI 2.0 - новая эра UI автоматизации
Мощь переполняет с JDI 2.0 - новая эра UI автоматизацииМощь переполняет с JDI 2.0 - новая эра UI автоматизации
Мощь переполняет с JDI 2.0 - новая эра UI автоматизацииSQALab
 
Как hh.ru дошли до 500 релизов в квартал без потери в качестве
Как hh.ru дошли до 500 релизов в квартал без потери в качествеКак hh.ru дошли до 500 релизов в квартал без потери в качестве
Как hh.ru дошли до 500 релизов в квартал без потери в качествеSQALab
 
Стили лидерства и тестирование
Стили лидерства и тестированиеСтили лидерства и тестирование
Стили лидерства и тестированиеSQALab
 
"Давайте не будем про качество"
"Давайте не будем про качество""Давайте не будем про качество"
"Давайте не будем про качество"SQALab
 
Apache.JMeter для .NET-проектов
Apache.JMeter для .NET-проектовApache.JMeter для .NET-проектов
Apache.JMeter для .NET-проектовSQALab
 
Тестирование геолокационных систем
Тестирование геолокационных системТестирование геолокационных систем
Тестирование геолокационных системSQALab
 
Лидер или босс? Вот в чем вопрос
Лидер или босс? Вот в чем вопросЛидер или босс? Вот в чем вопрос
Лидер или босс? Вот в чем вопросSQALab
 
От Зефира в коробке к Structure Zephyr или как тест-менеджеру перекроить внут...
От Зефира в коробке к Structure Zephyr или как тест-менеджеру перекроить внут...От Зефира в коробке к Structure Zephyr или как тест-менеджеру перекроить внут...
От Зефира в коробке к Structure Zephyr или как тест-менеджеру перекроить внут...SQALab
 

More from SQALab (20)

Готовим стажировку
Готовим стажировкуГотовим стажировку
Готовим стажировку
 
Куда приводят мечты? или Искусство развития тестировщика
Куда приводят мечты? или Искусство развития тестировщикаКуда приводят мечты? или Искусство развития тестировщика
Куда приводят мечты? или Искусство развития тестировщика
 
Оптимизация Selenium тестов и ускорение их поддержки
Оптимизация Selenium тестов и ускорение их поддержкиОптимизация Selenium тестов и ускорение их поддержки
Оптимизация Selenium тестов и ускорение их поддержки
 
Автоматизация 0.0: 0 - бюджет, 0 - опыт программирования
Автоматизация 0.0: 0 - бюджет, 0 - опыт программированияАвтоматизация 0.0: 0 - бюджет, 0 - опыт программирования
Автоматизация 0.0: 0 - бюджет, 0 - опыт программирования
 
Нагрузочное тестирование нестандартных протоколов с использованием Citrix и J...
Нагрузочное тестирование нестандартных протоколов с использованием Citrix и J...Нагрузочное тестирование нестандартных протоколов с использованием Citrix и J...
Нагрузочное тестирование нестандартных протоколов с использованием Citrix и J...
 
Continuous performance testing
Continuous performance testingContinuous performance testing
Continuous performance testing
 
Конфиги вместо костылей. Pytestconfig и зачем он нужен
Конфиги вместо костылей. Pytestconfig и зачем он нуженКонфиги вместо костылей. Pytestconfig и зачем он нужен
Конфиги вместо костылей. Pytestconfig и зачем он нужен
 
Команда чемпионов в ИТ стихии
Команда чемпионов в ИТ стихииКоманда чемпионов в ИТ стихии
Команда чемпионов в ИТ стихии
 
API. Серебряная пуля в магазине советов
API. Серебряная пуля в магазине советовAPI. Серебряная пуля в магазине советов
API. Серебряная пуля в магазине советов
 
Добиваемся эффективности каждого из 9000+ UI-тестов
Добиваемся эффективности каждого из 9000+ UI-тестовДобиваемся эффективности каждого из 9000+ UI-тестов
Добиваемся эффективности каждого из 9000+ UI-тестов
 
Делаем автоматизацию проектных KPIs
Делаем автоматизацию проектных KPIsДелаем автоматизацию проектных KPIs
Делаем автоматизацию проектных KPIs
 
Вредные привычки в тест-менеджменте
Вредные привычки в тест-менеджментеВредные привычки в тест-менеджменте
Вредные привычки в тест-менеджменте
 
Мощь переполняет с JDI 2.0 - новая эра UI автоматизации
Мощь переполняет с JDI 2.0 - новая эра UI автоматизацииМощь переполняет с JDI 2.0 - новая эра UI автоматизации
Мощь переполняет с JDI 2.0 - новая эра UI автоматизации
 
Как hh.ru дошли до 500 релизов в квартал без потери в качестве
Как hh.ru дошли до 500 релизов в квартал без потери в качествеКак hh.ru дошли до 500 релизов в квартал без потери в качестве
Как hh.ru дошли до 500 релизов в квартал без потери в качестве
 
Стили лидерства и тестирование
Стили лидерства и тестированиеСтили лидерства и тестирование
Стили лидерства и тестирование
 
"Давайте не будем про качество"
"Давайте не будем про качество""Давайте не будем про качество"
"Давайте не будем про качество"
 
Apache.JMeter для .NET-проектов
Apache.JMeter для .NET-проектовApache.JMeter для .NET-проектов
Apache.JMeter для .NET-проектов
 
Тестирование геолокационных систем
Тестирование геолокационных системТестирование геолокационных систем
Тестирование геолокационных систем
 
Лидер или босс? Вот в чем вопрос
Лидер или босс? Вот в чем вопросЛидер или босс? Вот в чем вопрос
Лидер или босс? Вот в чем вопрос
 
От Зефира в коробке к Structure Zephyr или как тест-менеджеру перекроить внут...
От Зефира в коробке к Structure Zephyr или как тест-менеджеру перекроить внут...От Зефира в коробке к Structure Zephyr или как тест-менеджеру перекроить внут...
От Зефира в коробке к Structure Zephyr или как тест-менеджеру перекроить внут...
 

Recently uploaded

Software Engineering Methodologies (overview)
Software Engineering Methodologies (overview)Software Engineering Methodologies (overview)
Software Engineering Methodologies (overview)eniolaolutunde
 
Introduction to AI in Higher Education_draft.pptx
Introduction to AI in Higher Education_draft.pptxIntroduction to AI in Higher Education_draft.pptx
Introduction to AI in Higher Education_draft.pptxpboyjonauth
 
“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...
“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...
“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...Marc Dusseiller Dusjagr
 
Contemporary philippine arts from the regions_PPT_Module_12 [Autosaved] (1).pptx
Contemporary philippine arts from the regions_PPT_Module_12 [Autosaved] (1).pptxContemporary philippine arts from the regions_PPT_Module_12 [Autosaved] (1).pptx
Contemporary philippine arts from the regions_PPT_Module_12 [Autosaved] (1).pptxRoyAbrique
 
Industrial Policy - 1948, 1956, 1973, 1977, 1980, 1991
Industrial Policy - 1948, 1956, 1973, 1977, 1980, 1991Industrial Policy - 1948, 1956, 1973, 1977, 1980, 1991
Industrial Policy - 1948, 1956, 1973, 1977, 1980, 1991RKavithamani
 
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptx
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptxPOINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptx
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptxSayali Powar
 
Mastering the Unannounced Regulatory Inspection
Mastering the Unannounced Regulatory InspectionMastering the Unannounced Regulatory Inspection
Mastering the Unannounced Regulatory InspectionSafetyChain Software
 
Incoming and Outgoing Shipments in 1 STEP Using Odoo 17
Incoming and Outgoing Shipments in 1 STEP Using Odoo 17Incoming and Outgoing Shipments in 1 STEP Using Odoo 17
Incoming and Outgoing Shipments in 1 STEP Using Odoo 17Celine George
 
How to Make a Pirate ship Primary Education.pptx
How to Make a Pirate ship Primary Education.pptxHow to Make a Pirate ship Primary Education.pptx
How to Make a Pirate ship Primary Education.pptxmanuelaromero2013
 
A Critique of the Proposed National Education Policy Reform
A Critique of the Proposed National Education Policy ReformA Critique of the Proposed National Education Policy Reform
A Critique of the Proposed National Education Policy ReformChameera Dedduwage
 
PSYCHIATRIC History collection FORMAT.pptx
PSYCHIATRIC   History collection FORMAT.pptxPSYCHIATRIC   History collection FORMAT.pptx
PSYCHIATRIC History collection FORMAT.pptxPoojaSen20
 
CARE OF CHILD IN INCUBATOR..........pptx
CARE OF CHILD IN INCUBATOR..........pptxCARE OF CHILD IN INCUBATOR..........pptx
CARE OF CHILD IN INCUBATOR..........pptxGaneshChakor2
 
Sanyam Choudhary Chemistry practical.pdf
Sanyam Choudhary Chemistry practical.pdfSanyam Choudhary Chemistry practical.pdf
Sanyam Choudhary Chemistry practical.pdfsanyamsingh5019
 
BASLIQ CURRENT LOOKBOOK LOOKBOOK(1) (1).pdf
BASLIQ CURRENT LOOKBOOK  LOOKBOOK(1) (1).pdfBASLIQ CURRENT LOOKBOOK  LOOKBOOK(1) (1).pdf
BASLIQ CURRENT LOOKBOOK LOOKBOOK(1) (1).pdfSoniaTolstoy
 
MENTAL STATUS EXAMINATION format.docx
MENTAL     STATUS EXAMINATION format.docxMENTAL     STATUS EXAMINATION format.docx
MENTAL STATUS EXAMINATION format.docxPoojaSen20
 
Micromeritics - Fundamental and Derived Properties of Powders
Micromeritics - Fundamental and Derived Properties of PowdersMicromeritics - Fundamental and Derived Properties of Powders
Micromeritics - Fundamental and Derived Properties of PowdersChitralekhaTherkar
 
18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf
18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf
18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdfssuser54595a
 
Alper Gobel In Media Res Media Component
Alper Gobel In Media Res Media ComponentAlper Gobel In Media Res Media Component
Alper Gobel In Media Res Media ComponentInMediaRes1
 
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...EduSkills OECD
 

Recently uploaded (20)

Software Engineering Methodologies (overview)
Software Engineering Methodologies (overview)Software Engineering Methodologies (overview)
Software Engineering Methodologies (overview)
 
Introduction to AI in Higher Education_draft.pptx
Introduction to AI in Higher Education_draft.pptxIntroduction to AI in Higher Education_draft.pptx
Introduction to AI in Higher Education_draft.pptx
 
“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...
“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...
“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...
 
Contemporary philippine arts from the regions_PPT_Module_12 [Autosaved] (1).pptx
Contemporary philippine arts from the regions_PPT_Module_12 [Autosaved] (1).pptxContemporary philippine arts from the regions_PPT_Module_12 [Autosaved] (1).pptx
Contemporary philippine arts from the regions_PPT_Module_12 [Autosaved] (1).pptx
 
Industrial Policy - 1948, 1956, 1973, 1977, 1980, 1991
Industrial Policy - 1948, 1956, 1973, 1977, 1980, 1991Industrial Policy - 1948, 1956, 1973, 1977, 1980, 1991
Industrial Policy - 1948, 1956, 1973, 1977, 1980, 1991
 
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptx
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptxPOINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptx
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptx
 
Mastering the Unannounced Regulatory Inspection
Mastering the Unannounced Regulatory InspectionMastering the Unannounced Regulatory Inspection
Mastering the Unannounced Regulatory Inspection
 
Model Call Girl in Bikash Puri Delhi reach out to us at 🔝9953056974🔝
Model Call Girl in Bikash Puri  Delhi reach out to us at 🔝9953056974🔝Model Call Girl in Bikash Puri  Delhi reach out to us at 🔝9953056974🔝
Model Call Girl in Bikash Puri Delhi reach out to us at 🔝9953056974🔝
 
Incoming and Outgoing Shipments in 1 STEP Using Odoo 17
Incoming and Outgoing Shipments in 1 STEP Using Odoo 17Incoming and Outgoing Shipments in 1 STEP Using Odoo 17
Incoming and Outgoing Shipments in 1 STEP Using Odoo 17
 
How to Make a Pirate ship Primary Education.pptx
How to Make a Pirate ship Primary Education.pptxHow to Make a Pirate ship Primary Education.pptx
How to Make a Pirate ship Primary Education.pptx
 
A Critique of the Proposed National Education Policy Reform
A Critique of the Proposed National Education Policy ReformA Critique of the Proposed National Education Policy Reform
A Critique of the Proposed National Education Policy Reform
 
PSYCHIATRIC History collection FORMAT.pptx
PSYCHIATRIC   History collection FORMAT.pptxPSYCHIATRIC   History collection FORMAT.pptx
PSYCHIATRIC History collection FORMAT.pptx
 
CARE OF CHILD IN INCUBATOR..........pptx
CARE OF CHILD IN INCUBATOR..........pptxCARE OF CHILD IN INCUBATOR..........pptx
CARE OF CHILD IN INCUBATOR..........pptx
 
Sanyam Choudhary Chemistry practical.pdf
Sanyam Choudhary Chemistry practical.pdfSanyam Choudhary Chemistry practical.pdf
Sanyam Choudhary Chemistry practical.pdf
 
BASLIQ CURRENT LOOKBOOK LOOKBOOK(1) (1).pdf
BASLIQ CURRENT LOOKBOOK  LOOKBOOK(1) (1).pdfBASLIQ CURRENT LOOKBOOK  LOOKBOOK(1) (1).pdf
BASLIQ CURRENT LOOKBOOK LOOKBOOK(1) (1).pdf
 
MENTAL STATUS EXAMINATION format.docx
MENTAL     STATUS EXAMINATION format.docxMENTAL     STATUS EXAMINATION format.docx
MENTAL STATUS EXAMINATION format.docx
 
Micromeritics - Fundamental and Derived Properties of Powders
Micromeritics - Fundamental and Derived Properties of PowdersMicromeritics - Fundamental and Derived Properties of Powders
Micromeritics - Fundamental and Derived Properties of Powders
 
18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf
18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf
18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf
 
Alper Gobel In Media Res Media Component
Alper Gobel In Media Res Media ComponentAlper Gobel In Media Res Media Component
Alper Gobel In Media Res Media Component
 
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
 

Test Data Preparation: Tips and Tricks

  • 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. When we are talking about best practice in Selenium test, 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 Oriented Generators 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 the steps how to get started with OKHttp and 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
  • 25. Best Practice vs. Bad Practice
  • 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 can be bypassed using two strategies: • The first idea is to disable CAPTCHAs in your test environment. • The second idea is to add a hook to allow tests to bypass the 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 choice to automate login into websites like Gmail and Facebook, firstly because it is against their policy and secondly because it is slow and unreliable. The most appropriate choice would be to use the API that these websites provide.
  • 32. SQA Days 2017 32 BEST PRACTICE VS. BAD PRACTICE Performance Testing Using WebDriver # Using selenium WebDriver is not an ideal choice for performance testing, not because it can’t do it but because it is not meant for this job ultimately tester 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