architecting test automation using selenium

19
1871 Hackers - March Meetup Architecting test automation using Selenium David Adams, QA Manager Kapow Events [email protected] www.linkedin.com/in/dadamschi

Upload: david-adams

Post on 15-Jul-2015

386 views

Category:

Technology


1 download

TRANSCRIPT

Page 1: Architecting test automation using selenium

1871 Hackers - March Meetup

Architecting test automation using Selenium

David Adams, QA Manager

Kapow Events

[email protected]/in/dadamschi

Page 2: Architecting test automation using selenium

about: David Adams

QA Manager @ Kapow Events

Currently architecting Selenium framework in Ruby

Built Selenium framework in Java

Architected automation framework in C#

Taught Selenium/Automation class for ForteKnowledge

Automating since 2009

Page 3: Architecting test automation using selenium

Soft Elements of a Framework

Vision

Buy-in

People

Code base

Page 4: Architecting test automation using selenium

Vision

Crucial

Provides a path for buy-in and development

No cocktail napkins

Page 5: Architecting test automation using selenium

Buy-in

Top-level champion

Software development process

Output is a robust code base

Secure and repeat functional regression

testing; NOT load testing

Goal is NOT to replace people

Page 6: Architecting test automation using selenium

People

Full-time resources are critical (at least 1)

Software development pipeline

Context switching is deadly

Credibility can get hurt

Automation gets shelved

Page 7: Architecting test automation using selenium

Code base

Keep language to dev language (if possible)

Configuration management

Use same resources as development (libraries,

et. al.)

Page 8: Architecting test automation using selenium

Hard Elements of a Framework

Test driver

Browser Driver

PageObjects

SeleniumGrid

Reporting

Parallelism

Page 9: Architecting test automation using selenium

Test driver

RSpec, TestNG, Cucumber

Creates a structure for running tests

Provides a list or groups of tests

Creates Before*, After* dynamic calls

Page 10: Architecting test automation using selenium

Browser driver

Selenium, WATIR

Provides browser commands (open, close/quit,

back, go to URL, etc)

Examines viewport for VISIBLE elements

If you can’t see it, you can’t act on it

Page 11: Architecting test automation using selenium

PageObjects

Automation development concept

Everything is an object

Each screen or component is a PageObject

Instantiated to organize code in OOP model

Allows for discrete elements on pages

Allows for inheritance of

footer/header/elements

Page 12: Architecting test automation using selenium
Page 13: Architecting test automation using selenium

Create a BasePage

Provides page-level methods

Creates page segmentation (footer, header,

content)

Page 14: Architecting test automation using selenium

SeleniumGrid

Hub/node model for execution of same tests

across different browsers and OSs

Need to maintain your own VMs (or

SauceLabs)

Need to maintain batch scripts on VMs

Page 15: Architecting test automation using selenium

Reporting

Publicly accessible report of each run

Each test is a story, explain what happened

Each step is reported with inputs, click text; not

just pass/fail of the entire test

Page 16: Architecting test automation using selenium

Parallelism

THIS saves time

Concerns:o data collision

o reporting

o development

Page 17: Architecting test automation using selenium

Test Cases

Procedural

Every evaluation is a test

Evaluate in test, not in PageObject

Do NOT ask a test to do only one thing

Use PageObjects to make code read-able

Page 18: Architecting test automation using selenium

Configuration Management

This is code!

Branch features for development

Allows for team scaling

Page 19: Architecting test automation using selenium

Gotchas

Elements expire

Record/playback doesn’t work

DON’T USE XPATH

Browser updates cause Se to stop working