Test Design: Scaling UI Automation
from the Ground Up
2
Quick Intro
Nikhil Kaul Rick Almeida
3
SmartBear’s technology stack
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
5
UI testing starts off great, but..
	
Expensive to maintain Not Stable Difficult to debug
6
Take the following as an example..
Text
Duplication
Maintainability
Magic Strings
7
Test pyramid strategy can come in handy
Service
Unit
UI
8
Having UI tests ensure thorough coverage
Browser: Chrome
End-to-end testing
x x x x
HTML5, Angular JS Network Service/API/Database
9
Create one page object for each page
Home Page of Amazon
Result Search Page
Product Details Page
Confirmation Page
10
Three ways to building upon page objects
2
Model 2
3
Model 3
Abstraction Increases
Model 1
1
11
Let’s start with abstraction model 1
Page Object Class 1
TestAbstract control identification
Test steps
Page Object Class 2
Abstract control identification
12
A real world example looks like
Redundancy
Maintainability
Abstracting control identification
Using the abstracted control identification
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
14
It still has one problem
Magic StringsLocating the control
Abstracting the set text action for the control
Using the abstracted set text action
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
Demo
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
Questions?

Test Design: Scaling UI Automation from the Ground Up

  • 1.
    Test Design: ScalingUI Automation from the Ground Up
  • 2.
  • 3.
  • 4.
    4 On our platetoday 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
  • 5.
    5 UI testing startsoff great, but.. Expensive to maintain Not Stable Difficult to debug
  • 6.
    6 Take the followingas an example.. Text Duplication Maintainability Magic Strings
  • 7.
    7 Test pyramid strategycan come in handy Service Unit UI
  • 8.
    8 Having UI testsensure thorough coverage Browser: Chrome End-to-end testing x x x x HTML5, Angular JS Network Service/API/Database
  • 9.
    9 Create one pageobject for each page Home Page of Amazon Result Search Page Product Details Page Confirmation Page
  • 10.
    10 Three ways tobuilding upon page objects 2 Model 2 3 Model 3 Abstraction Increases Model 1 1
  • 11.
    11 Let’s start withabstraction model 1 Page Object Class 1 TestAbstract control identification Test steps Page Object Class 2 Abstract control identification
  • 12.
    12 A real worldexample looks like Redundancy Maintainability Abstracting control identification Using the abstracted control identification
  • 13.
    13 Model 2 solvessome 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
  • 14.
    14 It still hasone problem Magic StringsLocating the control Abstracting the set text action for the control Using the abstracted set text action
  • 15.
    15 So to overcomethat 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
  • 16.
  • 17.
    17 Takeaways 1 UI tests arecritical 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
  • 18.