42
3kvk7 #ISKAWEBTEST Automatic web UI testing Using FitNesse, Selenium and Xebium Alex van Assem Rogier van het Schip

Automatic web ui testing

Embed Size (px)

DESCRIPTION

A presentation about the use of FitNesse, Xebium en Selenium to perform automatic web UI tests.

Citation preview

Page 1: Automatic web ui testing

3kvk7

#ISKAWEBTEST

Automatic web UI testing

Using FitNesse, Selenium and Xebium

Alex van AssemRogier van het Schip

Page 2: Automatic web ui testing

AgendaTest automationUsing Fitnesse + Xebium + Selenium

Automatic web UI testing 2

Live demos included!

Page 3: Automatic web ui testing

Test automationWhy use test automation?

Automatic web UI testing 3

Page 4: Automatic web ui testing

Test automation

Automatic web UI testing 4

Release 1

Sprint 1

PBI 1

PBI 2

PBI 3

Sprint 2

PBI 4

PBI 5

PBI 6

Sprint 3

PBI 7

PBI 8

PBI 9

Page 5: Automatic web ui testing

Using Fitnesse + Xebium + SeleniumGoal– Maintainable tests

• Re-usable• Hierarchical

– Low cost tooling– Usable with limited technical knowledge– Web-UI

Automatic web UI testing 5

Page 6: Automatic web ui testing

Testing Automation Pyramid

Automatic web UI testing 6

End-To-End

Integration

Unit

End-To-End

Integration

Unit

Flipping the Automated Testing Triangle: the Upshothttp://patrickwilsonwelsh.com/?p=32

Page 7: Automatic web ui testing

Three levels of End-to-End test automation

Automatic web UI testing 7

RuleWorkflow

TechnicalActivity

Clarity

Stability

Three levels of UI test automation http://gojko.net/2010/04/13/how-to-implement-ui-testing-without-shooting-yourself-in-the-foot-2/

Page 8: Automatic web ui testing

Selenium - DescriptionThe standard for Web UI testing

Selenium IDE (Firefox)– No hierarchy

Selenium Remote Control / Webdriver (C#, Java, etc)– Needs technical knowledge in C#

Automatic web UI testing 8

Page 9: Automatic web ui testing

Selenium IDE - Demo

Automatic web UI testing 9

Page 10: Automatic web ui testing

Automatic web UI testing 10

RuleWorkflow

TechnicalActivity

Three levels of End-to-End test automation

Page 11: Automatic web ui testing

FitNesse - DescriptionFitNesse is a high-level acceptance testing framework– Define and run acceptance tests

FitNesse is a wiki– Easy to use

FitNesse is a web server– It requires no configuration or setup

FitNesse is plugable– Fixtures

Automatic web UI testing 11

Page 12: Automatic web ui testing

FitNesse - Description

Automatic web UI testing 12

Testscripts c2Wmo

Page 13: Automatic web ui testing

FitNesse - DescriptionDefine tests in tables

And more tables, see Fitnesse.org

Automatic web UI testing 13

Table Description

Decision Table Supplies the inputs and outputs for decisions.

Query Table Supplies the expected results of a query.

Script Table A series of actions and checks.

Scenario Table A table that can be called from other tables.

Page 14: Automatic web ui testing

Fitnesse - Demo

Automatic web UI testing 14

Page 15: Automatic web ui testing

Automatic web UI testing 15

RuleWorkflow

TechnicalActivity

Three levels of End-to-End test automation

Page 16: Automatic web ui testing

Xebium - DescriptionFixture for FitNesse– Using FitNesse SLIM engine– Compatible with selenium 2.0 (Webdriver)

Add-on Selenium IDE– Record and replay– Export format

Automatic web UI testing 16

Page 17: Automatic web ui testing

Xebium - Demo

Automatic web UI testing 17

Page 18: Automatic web ui testing

FitNesse Structure

•Test scriptsTest Suites

Automatic web UI testing 18

Page 19: Automatic web ui testing

Automatic web UI testing 19

RuleWorkflow

TechnicalActivity

Xebium

Three levels of End-to-End test automation

Page 20: Automatic web ui testing

ImprovementsRe-usability - DRY (Don’t repeat yourself)MaintainabilityReadability

Automatic web UI testing 20

Page 21: Automatic web ui testing

Page Objects - Definition1. (A group of) methods on a page that

1. Do something (Actions)2. Verify something (Assertions)

2. Hide technical details on how

Automatic web UI testing 21

Page 22: Automatic web ui testing

Page Objects - Example

Automatic web UI testing 22

Menu Page Objects

Catalog Page Objects

AssertionAction

Page 23: Automatic web ui testing

Page Objects - Example

Automatic web UI testing 23

Checkout Page Objects

AssertionAction

Page 24: Automatic web ui testing

Page Objects - Example

Automatic web UI testing 24

Catalog Product Cart Checkout

Go to Product

Add Product to Cart

Fill personal information

Checkout Order

Set quantity of Product

Page object

Verify Product is

visible

Verify Product is not visible

Page 25: Automatic web ui testing

Page Objects - Demo

Automatic web UI testing 25

Page 26: Automatic web ui testing

FitNesse Structure

• Test scriptsTest Suites

• Action steps• Assertion steps

Page Objects

Automatic web UI testing 26

Page 27: Automatic web ui testing

Automatic web UI testing 27

RuleWorkflow

TechnicalActivity

Xebium

Page Objects

Three levels of End-to-End test automation

Page 28: Automatic web ui testing

Flow objects - DefinitionFlows over Page Object boundaries

Automatic web UI testing 28

Page 29: Automatic web ui testing

Flow objects - Example

Automatic web UI testing 29

Catalog Product Cart Checkout

Go to Product

Add Product to Cart

Fill personal information

Checkout Order

Set quantity of Product

Page object

Flow ObjectVerify Product is

visible

Verify Product is not visible

Page 30: Automatic web ui testing

Flow Objects - Demo

Automatic web UI testing 30

Page 31: Automatic web ui testing

FitNesse Structure• Test ScriptsTest Suites

• Action steps• Assertion stepsPage Objects

• FlowsFlow Objects

Automatic web UI testing 31

Page 32: Automatic web ui testing

Automatic web UI testing 32

RuleWorkflow

TechnicalActivity

Xebium

Page ObjectsFlow Objects

Three levels of End-to-End test automation

Page 33: Automatic web ui testing

ImprovementsReadable for Business

Automatic web UI testing 33

Page 34: Automatic web ui testing

GivenWhenThen Demo

Automatic web UI testing 34

Page 35: Automatic web ui testing

FitNesse Structure• Test ScriptsTest Suites

• Action steps• Assertion stepsPage Objects

• FlowsFlow Objects

Automatic web UI testing 35

Page 36: Automatic web ui testing

Automatic web UI testing 36

RuleWorkflow

TechnicalActivity

Xebium

Page ObjectsFlow Objects

Three levels of End-to-End test automation

Page 37: Automatic web ui testing

ImprovementsMultibrowser– Internet Explorer– Firefox– Chrome

Automatic web UI testing 37

Page 38: Automatic web ui testing

Multi browser - Demo

Automatic web UI testing 38

Page 39: Automatic web ui testing

FitNesse Structure• Test ScriptsTest Suites

• Action steps• Assertion stepsPage Objects

• FlowsFlow Objects

• Internet Explorer• Firefox

Browser Configuraties

Automatic web UI testing 39

Page 40: Automatic web ui testing

Automatic web UI testing 40

RuleWorkflow

TechnicalActivity

Xebium

Page ObjectsFlow Objects

Three levels of End-to-End test automation

Page 41: Automatic web ui testing

SummaryFitNesse + Xebium + Selenium is a good combination for test automationUse Page and Flow objectsMake tests readable for business

Automatic web UI testing 41

Page 42: Automatic web ui testing

Questions?

3kvk7

Automatic web UI testing 42