Design Patterns - LFM and POM
-
Upload
john-staveley -
Category
Technology
-
view
538 -
download
2
Transcript of Design Patterns - LFM and POM
![Page 1: Design Patterns - LFM and POM](https://reader034.fdocuments.us/reader034/viewer/2022050916/58aa235f1a28abff6b8b61d3/html5/thumbnails/1.jpg)
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
![Page 2: Design Patterns - LFM and POM](https://reader034.fdocuments.us/reader034/viewer/2022050916/58aa235f1a28abff6b8b61d3/html5/thumbnails/2.jpg)
A sample page to test
![Page 3: Design Patterns - LFM and POM](https://reader034.fdocuments.us/reader034/viewer/2022050916/58aa235f1a28abff6b8b61d3/html5/thumbnails/3.jpg)
Our test: The meaning of life, the universe and everything....
CF: Hitchhikers guide to the galaxy, computer at the end of the universe
![Page 4: Design Patterns - LFM and POM](https://reader034.fdocuments.us/reader034/viewer/2022050916/58aa235f1a28abff6b8b61d3/html5/thumbnails/4.jpg)
The meaning of life
6x7=42
![Page 5: Design Patterns - LFM and POM](https://reader034.fdocuments.us/reader034/viewer/2022050916/58aa235f1a28abff6b8b61d3/html5/thumbnails/5.jpg)
Export the test case
![Page 6: Design Patterns - LFM and POM](https://reader034.fdocuments.us/reader034/viewer/2022050916/58aa235f1a28abff6b8b61d3/html5/thumbnails/6.jpg)
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 7: Design Patterns - LFM and POM](https://reader034.fdocuments.us/reader034/viewer/2022050916/58aa235f1a28abff6b8b61d3/html5/thumbnails/7.jpg)
Page Object Model
Create a class to represent the page Abstract away the operation of the web testing framework
![Page 8: Design Patterns - LFM and POM](https://reader034.fdocuments.us/reader034/viewer/2022050916/58aa235f1a28abff6b8b61d3/html5/thumbnails/8.jpg)
Page Object Model in a test
![Page 9: Design Patterns - LFM and POM](https://reader034.fdocuments.us/reader034/viewer/2022050916/58aa235f1a28abff6b8b61d3/html5/thumbnails/9.jpg)
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
![Page 10: Design Patterns - LFM and POM](https://reader034.fdocuments.us/reader034/viewer/2022050916/58aa235f1a28abff6b8b61d3/html5/thumbnails/10.jpg)
LFM – Basic Example
![Page 11: Design Patterns - LFM and POM](https://reader034.fdocuments.us/reader034/viewer/2022050916/58aa235f1a28abff6b8b61d3/html5/thumbnails/11.jpg)
LFM – Bad example
![Page 12: Design Patterns - LFM and POM](https://reader034.fdocuments.us/reader034/viewer/2022050916/58aa235f1a28abff6b8b61d3/html5/thumbnails/12.jpg)
LFM = BDD
![Page 13: Design Patterns - LFM and POM](https://reader034.fdocuments.us/reader034/viewer/2022050916/58aa235f1a28abff6b8b61d3/html5/thumbnails/13.jpg)
![Page 14: Design Patterns - LFM and POM](https://reader034.fdocuments.us/reader034/viewer/2022050916/58aa235f1a28abff6b8b61d3/html5/thumbnails/14.jpg)
LFM