test design: scaling ui automation from the ground up

18
Test Design: Scaling UI Automation from the Ground Up

Upload: smartbear-software

Post on 12-Jan-2017

191 views

Category:

Software


2 download

TRANSCRIPT

Page 1: Test Design: Scaling UI Automation from the Ground Up

Test Design: Scaling UI Automation from the Ground Up

Page 2: Test Design: Scaling UI Automation from the Ground Up

2

Quick Intro

Nikhil Kaul Rick Almeida

Page 3: Test Design: Scaling UI Automation from the Ground Up

3

SmartBear’s technology stack

Page 4: Test Design: Scaling UI Automation from the Ground Up

4

On our plate today

5

Application of these frameworks in real world

1

Where does UI automation go wrong?

2

Why UI tests are critical?

4

Design frameworks to overcome the UI challenges

3

An example of a badly written test

Page 5: Test Design: Scaling UI Automation from the Ground Up

5

UI testing starts off great, but..

Expensive to maintain

Not Stable Difficult to debug

Page 6: Test Design: Scaling UI Automation from the Ground Up

6

Take the following as an example..

Text

Duplication

Maintainability

Magic Strings

Page 7: Test Design: Scaling UI Automation from the Ground Up

7

Test pyramid strategy can come in handy

Service

Unit

UI

Page 8: Test Design: Scaling UI Automation from the Ground Up

8

Having UI tests ensure thorough coverage

Browser: Chrome

End-to-end testing

x x x x

HTML5, Angular JS Network Service/API/Database

Page 9: Test Design: Scaling UI Automation from the Ground Up

9

Create one page object for each page

Home Page of Amazon

Result Search Page

Product Details Page

Confirmation Page

Page 10: Test Design: Scaling UI Automation from the Ground Up

10

Three ways to building upon page objects

2

Model 2

3

Model 3

Abstraction Increases

Model 1

1

Page 11: Test Design: Scaling UI Automation from the Ground Up

11

Let’s start with abstraction model 1

Page Object Class 1

Test

Abstract control identification

Test steps

Page Object Class 2

Abstract control identification

Page 12: Test Design: Scaling UI Automation from the Ground Up

12

A real world example looks like

Redundancy

Maintainability

Abstracting control identification

Using the abstracted control identification

Page 13: Test Design: Scaling UI Automation from the Ground Up

13

Model 2 solves some of these problems

Page Object Class 1

Test

Page Object Class 2

Abstract control identification

Test steps

Abstract control identification

Abstract control actions

Abstract control actions

Page 14: Test Design: Scaling UI Automation from the Ground Up

14

It still has one problem

Magic Strings Locating the control

Abstracting the set text action for the control

Using the abstracted set text action

Page 15: Test Design: Scaling UI Automation from the Ground Up

15

So to overcome that we have 3rd model

Page Object 1

Test

Page Object 2

Abstract finding controls

Abstract finding controls

Test Steps

Abstract actions

Abstract actions

Abstract magic strings

Abstract magic strings

Page 16: Test Design: Scaling UI Automation from the Ground Up

Demo

Page 17: Test Design: Scaling UI Automation from the Ground Up

17

Takeaways 1

UI tests are critical for determining end-to-end behavior

2

Implement a page object model

4

The abstraction increases as you move from framework 1 to 3

3

3 design frameworks to overcome UI challenges

Page 18: Test Design: Scaling UI Automation from the Ground Up

Questions?