design patterns - lfm and pom

Post on 22-Jan-2018

538 Views

Category:

Technology

2 Downloads

Preview:

Click to see full reader

TRANSCRIPT

Design Patterns - POM and LFM

Leeds Sharp 27/08/2015 by John Staveley

Page Object Model and Logical Functional Model For automated user testing Selenium, WatiN, CodedUI etc Increase maintainability and reduce brittleness of UI tests NB: I assume you've used a UI testing framework (we'll be using Selenium) from www.seleniumhq.org – a

firefox addin

A sample page to test

Our test: The meaning of life, the universe and everything....

CF: Hitchhikers guide to the galaxy, computer at the end of the universe

The meaning of life

6x7=42

Export the test case

Some maintenance issues

6+1-2=5 66/11=6 6*4=24 56-39=18 Any change to the number 6 breaks all of these tests

Page Object Model

Create a class to represent the page Abstract away the operation of the web testing framework

Page Object Model in a test

Logical Functional Model (LFM)

Sits as a layer above POM Abstracts away further the implementation of interacting with

a page Increases reuse of your test code, particularly repeated

operations Enables less technical users to create tests

LFM – Basic Example

LFM – Bad example

LFM = BDD

LFM

top related