Stacking The Automation Deck - STPCon · Telecom Company es Proprietary APIs Test Head Test...

15
4/2/2019 1 @pgrizzaffi #STPCon Stacking The Automation Deck @pgrizzaffi #STPCon Paul Grizzaffi Principal Automation Architect at Magenic Career focused on automation Advisor STPCon Advanced Research Center for STQA at UT Dallas Who Is This Guy? 1 2

Transcript of Stacking The Automation Deck - STPCon · Telecom Company es Proprietary APIs Test Head Test...

Page 1: Stacking The Automation Deck - STPCon · Telecom Company es Proprietary APIs Test Head Test Services “DSL” Script (C++) es #STPCon @pgrizzaffi Single-Board Computers Proprietary

4/2/2019

1

@pgrizzaffi#STPCon

Stacking The Automation Deck

@pgrizzaffi#STPCon

Paul Grizzaffi

Principal Automation Architect at Magenic

Career focused on automation

Advisor

STPCon

Advanced Research Center for STQA at UT Dallas

Who Is This Guy?

1

2

Page 2: Stacking The Automation Deck - STPCon · Telecom Company es Proprietary APIs Test Head Test Services “DSL” Script (C++) es #STPCon @pgrizzaffi Single-Board Computers Proprietary

4/2/2019

2

@pgrizzaffi#STPCon

Where Is This Guy?

http://www.linkedin.com/in/paulgrizzaffi

@pgrizzaffi

http://responsibleautomation.wordpress.com

[email protected]

@pgrizzaffi#STPCon

Plan To Write Your Own Framework?

At the very least, don’t start there

3

4

Page 3: Stacking The Automation Deck - STPCon · Telecom Company es Proprietary APIs Test Head Test Services “DSL” Script (C++) es #STPCon @pgrizzaffi Single-Board Computers Proprietary

4/2/2019

3

@pgrizzaffi#STPCon

Stack The Deck

@pgrizzaffi#STPCon

5

6

Page 4: Stacking The Automation Deck - STPCon · Telecom Company es Proprietary APIs Test Head Test Services “DSL” Script (C++) es #STPCon @pgrizzaffi Single-Board Computers Proprietary

4/2/2019

4

@pgrizzaffi#STPCon

“a skeletal, openwork, or structural frame”*

“A framework calls you”**

What’s A Framework?

* Merriam-Webster

** Attribution unknown

@pgrizzaffi#STPCon

“an orderly pile or heap” *

Not the “classic” computer science definition

What’s A Stack?

* Merriam-Webster

7

8

Page 5: Stacking The Automation Deck - STPCon · Telecom Company es Proprietary APIs Test Head Test Services “DSL” Script (C++) es #STPCon @pgrizzaffi Single-Board Computers Proprietary

4/2/2019

5

@pgrizzaffi#STPCon

Why A Stack?

Card

Spade

Diamond

Club

Heart

Reusable

@pgrizzaffi#STPCon

Why Not A Framework?

9

10

Page 6: Stacking The Automation Deck - STPCon · Telecom Company es Proprietary APIs Test Head Test Services “DSL” Script (C++) es #STPCon @pgrizzaffi Single-Board Computers Proprietary

4/2/2019

6

@pgrizzaffi#STPCon

Raw Tools

Abstraction

Actions

Behaviors

Script

Reusable

groups of

actions

Domain-specific

actions

Future-proofing

and “help”

Conceptual StackU

tiliti

es

Reusable

helpers

@pgrizzaffi#STPCon

Scripts Behaviors Actions

login_link:element =

get_element.by_id(“foo”);return element;

TC400:login(“ace”, “passwd”);do_something();. . .

TC2:login(“gene”, “passwd”);do_something();

login(id, pw):login_link.click();id_field = id;password_field = pw;ok_button.click();logout_link.should_exist();

TC1:login(“peter”, “passwd”);do_something(); do_something_else();

UH

OH!

A Stack Example

11

12

Page 7: Stacking The Automation Deck - STPCon · Telecom Company es Proprietary APIs Test Head Test Services “DSL” Script (C++) es #STPCon @pgrizzaffi Single-Board Computers Proprietary

4/2/2019

7

@pgrizzaffi#STPCon

Scripts Behaviors Actions

login_link:element =

get_element.by_id(“bar”);return element;

login(id, pw):login_link.click();id_field = id;password_field = pw;ok_button.click();logout_link.should_exist();

A Stack Example

TC400:login(“ace”, “passwd”);do_something();. . .

TC2:login(“gene”, “passwd”);do_something();

TC1:login(“peter”, “passwd”);do_something(); do_something_else();

UH

OH!

@pgrizzaffi#STPCon

Scripts Behaviors Actions

login_link:element =

get_element.by_id(“bar”);return element;

login(id, pw):login_link.click();id_field = id;password_field = pw;ok_button.click();logout_link.should_exist();profile_link.should_exist();

Less Maintenance!

A Stack Example

TC400:login(“ace”, “passwd”);do_something();. . .

TC2:login(“gene”, “passwd”);do_something();

TC1:login(“peter”, “passwd”);do_something(); do_something_else();

13

14

Page 8: Stacking The Automation Deck - STPCon · Telecom Company es Proprietary APIs Test Head Test Services “DSL” Script (C++) es #STPCon @pgrizzaffi Single-Board Computers Proprietary

4/2/2019

8

@pgrizzaffi#STPCon

Raw Tools

Abstraction

Actions

Behaviors

Script

Telecom Company

Uti

liti

es

Proprietary APIs

Test Head

Test Services

“DSL”

Script (C++)

Uti

liti

es

@pgrizzaffi#STPCon

Single-BoardComputers

ProprietaryHardware

SystemUnderTest

UserTerminal

SharedWorkstation

Test Services

“DSLs”

Script (C++) Test Head

Proprietary APIs

Telecom Company – Automation Infrastructure (Partial)

15

16

Page 9: Stacking The Automation Deck - STPCon · Telecom Company es Proprietary APIs Test Head Test Services “DSL” Script (C++) es #STPCon @pgrizzaffi Single-Board Computers Proprietary

4/2/2019

9

@pgrizzaffi#STPCon

Raw Tools

Abstraction

Actions

Behaviors

Script

E-Commerce Organization – WebSpec

Uti

liti

es

WebSpec

Finders

“DSL”

Script (Ruby)

Uti

liti

es

@pgrizzaffi#STPCon

Raw Tools

Abstraction

Actions

Behaviors

Script

E-Commerce Organization – Selenium

Uti

liti

es

Selenium

Selenium Wrapper

Finders

“DSL”

Script (Ruby)

Uti

liti

es

17

18

Page 10: Stacking The Automation Deck - STPCon · Telecom Company es Proprietary APIs Test Head Test Services “DSL” Script (C++) es #STPCon @pgrizzaffi Single-Board Computers Proprietary

4/2/2019

10

@pgrizzaffi#STPCon

SpecFlow Feature File

Script (C#)

Raw Tools

Abstraction

Actions

Behaviors

Script

SaaS Company

Uti

liti

es

Selenium

Selenium Wrapper

SpecFlow Step File

Uti

liti

es

“DSL”

Page Objects

@pgrizzaffi#STPCon

SpecFlow Feature File

Script

(C#/Java)

Raw Tools

Abstraction

Actions

Behaviors

Script

Magenic

Uti

liti

es

Selenium

Web Service

Appium

Wrapper

SpecFlow Step File

Uti

liti

es

“DSL”

Models

19

20

Page 11: Stacking The Automation Deck - STPCon · Telecom Company es Proprietary APIs Test Head Test Services “DSL” Script (C++) es #STPCon @pgrizzaffi Single-Board Computers Proprietary

4/2/2019

11

@pgrizzaffi#STPCon

Layers can make debugging a challenge

Higher layers may hide lower layers’ details

Each layer logs

Context-sensitive

Domain-appropriate

Logging and Error Reports

@pgrizzaffi#STPCon

I Just Want To Buy A CD

FileName1, 49: Failed to add “Bark At The Moon” to the cart

FileName2, 107: Couldn’t find the “Add to cart” button when you tried to click it

FileName3, 55: WebElement with ID “flum-lmnop-697142112” could not be found

21

22

Page 12: Stacking The Automation Deck - STPCon · Telecom Company es Proprietary APIs Test Head Test Services “DSL” Script (C++) es #STPCon @pgrizzaffi Single-Board Computers Proprietary

4/2/2019

12

@pgrizzaffi#STPCon

Outside Of Test Scripts

Raw Tools

Abstraction

Actions

Behaviors

Script

Selenium

Selenium Wrapper

Random Link

Clicker

Selenium

Selenium Wrapper

Finders

Order Pumper

@pgrizzaffi#STPCon

23

24

Page 13: Stacking The Automation Deck - STPCon · Telecom Company es Proprietary APIs Test Head Test Services “DSL” Script (C++) es #STPCon @pgrizzaffi Single-Board Computers Proprietary

4/2/2019

13

@pgrizzaffi#STPCon

Experiences of Test Automation Stack

Experiences of Test Automation; Graham, Fewster

@pgrizzaffi#STPCon

Beware!

25

26

Page 14: Stacking The Automation Deck - STPCon · Telecom Company es Proprietary APIs Test Head Test Services “DSL” Script (C++) es #STPCon @pgrizzaffi Single-Board Computers Proprietary

4/2/2019

14

@pgrizzaffi#STPCon

What goes in which layer?

It matters and it doesn’t

What matters is that someone is overseeing

Stewardship

@pgrizzaffi#STPCon

General Guidance

Raw Tools

Abstraction

Actions

Behaviors

Script

General

Domain Specific

More Granular

Less Granular

Judicious Access

27

28

Page 15: Stacking The Automation Deck - STPCon · Telecom Company es Proprietary APIs Test Head Test Services “DSL” Script (C++) es #STPCon @pgrizzaffi Single-Board Computers Proprietary

4/2/2019

15

@pgrizzaffi#STPCon

Stacks are portable – frameworks, non-traditional automation

Use software development idioms

Appropriate logging and error messages are critical

Stewardship required

TL;DR

@pgrizzaffi#STPCon

Question Time!

http://www.linkedin.com/in/paulgrizzaffi

@pgrizzaffi

http://responsibleautomation.wordpress.com

[email protected]

29

30