Download - Brace yourself from automation death trap
Brace yourself from the
Automation TrapPrasad
Kalgutkar
Why we Automate?
Fast Feedback
Input
Result
Save Time & Money
Perform Exploratory TestingAnalyze future requirementsDeliver on time
Then why we fail?
Too much of unwanted
automationSource: http://www.energizers.com/portfolio-view/entangled
Automation done Perfunctory!
Damn! We have agreed to
automate, let me write some tests
“Are we building it correctly?”
My journey of challenges
eCommerce
Train Travel
Airline Travel
Airline domain with a big Enterprise Org StructureMobile App Development & Frequent ReleasesMixed Skilled Testing TeamDistributed team across 4 locations
As a Agile QA,What it meant
to me?
…automation serving
as a help&
not an overhead!
Some food for thought!
#1Let automation run in
the blood!
Be thoughtful while automating
Design &
ToolsClean Coding
How much?
&Where
to?
Runs on CI
QA Build from
CI
# Break the silos in testing
# Every QA, contributes to automation
# Best when
business refers your test-cases
Let’s Refactor!
Fail Fast,Grow Right!
Add,Delete,Merge!
Optimize as you
proceed
#2Aim for the Test
Pyramid
Test PyramidManual /
Exploratory
Impact
Business
FacingTests
Technology FacingTests
TimeCost
Integration
JavaScript
Web Service
UI
Unit
View
Courtesy: Anand Bagmar-What is Agile Testing?
# Unit TestsFor iOS, Android, MWeb codeDevs own while doing TDD # Integration
TestsDevs own while doing TDD
# Functional TestsFocus only E2EQAs/Devs own it # GUI E2E
TestsFocus on UI detailsQAs/Devs own it
#3Strongly dependent on OOPs concepts
We usedPage Objects
User ProfileInformation
AccountsHistoryTransfers Apply
Loan
Account Balance
Open Demat
Home Page
The right way...
● Has only required user services
● Knows about the Locators & Next Navigation!
● Delegates user actions to Driver
● Registered with Page Registry
User ProfileInformation
AccountsHistoryTransfers Apply
Loan
Account Balance
Open Demat
Home Page
DefineHard-
workingDriver
The Driver,
=> Provides actions to Page
Objects
=> May have setup methods
=> Takes care of Waits
Single Test Layer⇒
Invokes single step implementation
⇒Calls relevant
Page Objects⇒
Respective library do user actions
Our Eco-system
#4Test Cases: Try Behavior Driven
How Cukes helped …
=> Scenarios are E2E only
=> Acted as the Framework
=> Everyone collaborates!
Given a ...
When I ...
Then I ...
Scenario : To test...
Do’s
●Build independent test scenarios grouped in functional chunks
● If not cukes, provide sensible names to the tests
●Avoid setups in test-cases layer
#5Maintainable Test
Data
Keep it understan
dable
Keep it close to domain
Keep it simple
In the scenario...
WhenI search for flight with|origin |destination |type || BOM | DEL | One way|
ThenI should get “13A” as “aisle” seat
Test Data Hash...
When I enter “VISA” card details
Def testCards {“VISA” => {
“Num” => “400010004000”
“Exp Month” => “10”
“Exp Year” => “},“AMEX” => {
………
},}
Test Data Objects...
GivenI have a “delayed_multi_pax” PNR in my trips
some_step_def_method(type){
myPnr =PnrFactory.getPnr(type)...}
Avoid data sheets or
CSVs
Leverage the
tech stack
Avoid data fetching from DB
#6Test the Framework
B’coz,
●Drivers, Page Objects are core!
●As the project grows, so do the contributors!
●When automation is the backbone of project delivery
“Get them running…”
Get Continuous Integration
“ …is a software development practice where members of a team integrate their work frequently, usually each person integrates at least daily - leading to multiple integrations per day…Each integration is verified by an automated build to detect integration errors as quickly as possible … “
- Martin Fowler, ThoughtWorks Chief Scientisthttp://www.thoughtworks.com/continuous-integration
Continuous Integration
“Every experience, no
matter how bad it seems…
Holds a blessing of some kind”
- Gautam Buddha
Thank You