SlideShare a Scribd company logo
1 
Automation Abstractions: 
Page Objects and Beyond 
Alan Richardson 
@eviltester 
https://xp-dev.com/svn/AutomationAbstractions 
www.SeleniumSimplified.com 
www.EvilTester.com 
www.CompendiumDev.co.uk 
www.JavaForTesters.com
2 
What is Abstraction? 
● Modelling 
● Separation of concerns 
● Logical vs Physical 
● Functional vs Structural 
● Interfaces vs Implementations 
● Data / Entities / Persistence 
● Functionality / Task Flow 
● Goals / Strategies 
● Layers – GUI, DB, HTTP 
● Etc.
“I must create a system. or be 
enslav'd by another Mans; I 
will not reason & compare: 
my business is to create” 
William Blake, 1820 
Jerusalem: The Emanation of the Giant Albion 
3 
http://www.blakearchive.org/exist/blake/archive/object.xq?objectid=jerusalem.e.illbk.10&java=no
https://xp-dev.com/svn/AutomationAbstractions 
4 
Example Test Without 
Abstraction 
@Before 
public void startDriver(){ 
@Test 
public void canCreateAToDoWithNoAbstraction(){ 
driver.get("http://todomvc.com/architecture-examples/backbone/"); 
int originalNumberOfTodos = driver.findElements( 
By.cssSelector("ul#todo-list li")).size(); 
WebElement createTodo = driver.findElement(By.id("new-todo")); 
createTodo.click(); 
createTodo.sendKeys("new task"); 
createTodo.sendKeys(Keys.ENTER); 
assertThat(driver.findElement( 
By.id("filters")).isDisplayed(), is(true)); 
int newToDos = driver.findElements( 
By.cssSelector("ul#todo-list li")).size(); 
assertThat(newToDos, greaterThan(originalNumberOfTodos)); 
} 
driver = new FirefoxDriver(); 
} 
@After 
public void stopDriver(){ 
driver.close(); 
driver.quit(); 
} 
NoAbstractionTest.java
But this does use some 
abstraction layers 
LLooccaattoorr A Abbssttrraaccttioionns 
WebElement Generic Element Abstraction 
5 
Example Test Without 
Abstraction 
@Before 
public void startDriver(){ 
WebDriver Generic Browser Abstraction 
@Test 
public void canCreateAToDoWithNoAbstraction(){ 
Firefox Browser Abstraction 
driver.get("http://todomvc.com/architecture-examples/backbone/"); 
int originalNumberOfTodos = driver.findElements( 
By.cssSelector("ul#todo-list li")).size(); 
WebElement createTodo = driver.findElement(By.id("new-todo")); 
createTodo.click(); 
createTodo.sendKeys("new task"); 
createTodo.sendKeys(Keys.ENTER); 
assertThat(driver.findElement( 
By.id("filters")).isDisplayed(), is(true)); 
int newToDos = driver.findElements( 
Manipulation Abstractions 
By.cssSelector("ul#todo-list li")).size(); 
assertThat(newToDos, greaterThan(originalNumberOfTodos)); 
} 
driver = new FirefoxDriver(); 
} 
@After 
public void stopDriver(){ 
driver.close(); 
driver.quit(); 
} 
NoAbstractionTest.java
6 
WebDriver provides abstractions 
● Browser 
● DOM 
● Web Element 
Tool vendors gain value from generic abstractions. 
You gain value from 'domain' abstractions.
7 
Example Test With Abstraction 
@Before 
public void startDriver(){ 
@Test 
public void canCreateAToDoWithAbstraction(){ 
TodoMVCUser user = 
new TodoMVCUser(driver, new TodoMVCSite()); 
user.opensApplication().and().createNewToDo("new task"); 
ApplicationPageFunctional page = 
new ApplicationPageFunctional(driver, 
new TodoMVCSite()); 
assertThat(page.getCountOfTodoDoItems(), is(1)); 
assertThat(page.isFooterVisible(), is(true)); 
} 
driver = new FirefoxDriver(); 
} 
@After 
public void stopDriver(){ 
driver.close(); 
driver.quit(); 
} 
NoAbstractionTest.java
8 
Why Abstraction? 
● Change implementations 
● Single Responsibility – only changes when 
necessary 
● Makes automation readable and maintainable 
● We can unit test some of our test code 
● etc. 
https://xp-dev.com/svn/AutomationAbstractions
9 
Some Abstraction Layer Categories 
1) Data 
– Generic Data Abstractions e.g. email, postcode 
2) Physical 
– Physical layout of your application e.g. pages, 
components 
– Navigation across pages 
3) Domain 
– Your application Entities domain e.g. user, account 
4) Logical 
– User actions, workflows
10 
Common Automation Abstractions 
● Page Objects: pages, components, widgets 
● Dom Element Abstractions: select, textbox, etc. 
● Domain Objects: user, account, order 
● Gherkin (Given/When/And/Then) 
● Domain Specific Languages: code, keywords 
● ... 
https://xp-dev.com/svn/AutomationAbstractions
11 
Abstraction != Implementation 
● Abstraction != Tool / Framework / 
Implementation 
● Gherkin != Cucumber 
● Page Object != Page Factory / Slow Loadable 
● DSL != Keyword Driven 
If we want to get good at abstraction then we 
need to model, split apart, make the relationships 
clear, and be aware of our options.
12 
Page Objects 
● The most obvious 
automation abstraction 
● What is it? 
– A page? A Component? 
● Do web applications still 
have pages?
A Page Object that abstracts a Page 
13 
● Often has methods for 
– Opening the page 
– Accessing elements 
– Doing stuff, and navigating as a side-effect 
– Logical high level functionality e.g. login 
– Low level physical functionality e.g. 
typeUsername, clickLoginButton 
Should a Page Object be responsible for all of 
this?
14 
Page Object Design Decisions 
● What methods does it have? 
– Functional 
● login(username, password), 
● loginAs(user) 
– Structural 
● enterName(username), enterPassword(password), 
clickLogin(), submitLoginForm(username, password) 
● Does it expose elements or not? 
– public WebElement loginButton; 
– public WebElement getLoginButton(); 
– public clickLoginButton();
15 
Page Object Functionality 
Approaches 
● Expose WebElements Directly 
– Leads to WebElement Abstractions 
– public TextField userNameField; 
● Hide WebElements behind physical functional 
methods e.g. typeUserName("bob"); 
● Logical helper methods e.g. 
loginAs(name,pass) 
● Layers of Page Objects 
– Physical 
– Logical
16 
Navigation Design Decisions 
● Does a Page Object return other pages? 
public IssueListPage submit(){ 
driver.findElement(By.id(“submit”)).click(); 
return new IssueListPage(driver); 
} 
● Or Navigate implicitly after interactions 
● Or have navigation objects
17 
Implicit or Explicit Wait? 
● Implicit Wait 
driver.manage().timeouts(). 
implicitlyWait(15L, TimeUnit.SECONDS); 
assertThat(driver.findElement( 
By.id("filters")).isDisplayed() 
, is(true)); 
● Explicit Wait 
driver.manage().timeouts(). 
implicitlyWait(0L, TimeUnit.SECONDS); 
WebDriverWait wait = new WebDriverWait(driver,15); 
wait.until(ExpectedConditions.elementToBeClickable 
(By.id("filters"))); 
Example: 'NoAbstractionTest.java'
18 
Implementing Page Objects 
● POJO 
– Plain object, driver in constructor, methods use 
driver.<method> 
● Page Factory 
– Annotated elements, lazy instantiation via reflection 
● LoadableComponent 
– Common interface (load, isLoaded), isLoaded 
throws Error 
● SlowLoadableComponent 
– Common interface, waits for on isLoaded 
● Other approaches?
19 
Example Implementations 
https://xp-dev.com/svn/AutomationAbstractions
20 
POJO 
● 'ApplicationPage.java' 
– Used in 'SequentialCreationOfTest.java' 
– Not much refactoring in the example 
● Simple Class 
● WebDriver passed to constructor 
● Composition of any components 
● e.g. 
– com.seleniumsimplified.todomvc.page.pojo 
– 'ApplicationPage.java' 
● Not much refactoring in the example
Pojo Example 
21
22 
Functional vs Structural 
● Functional 
– loginAs(username, password) 
● Structural 
– enterUsername 
– enterPassword 
– clickLoginButton 
– submitLoginForm(username, password)
23 
Functional Vs Structural Example 
● One way of answering “what methods to put on 
a page object” 
– Is it functional / behavioural? 
– Is it structural / Physical? 
● Functional 'uses' Structural implementation 
● Why? 
– Sometimes it is just a naming difference 
– Handling exceptions in functional but not structural 
– Higher level methods in Functional 
– Different concepts e.g. deleteLastItem
24 
Page Factory 
● Annotate fields with @FindBy 
● Instantiate in constructor using 
PageFactory.initElements 
– Can create your own page factory initialiser 
● Avoids boilerplate accessor methods 
● Fast to create Page Objects 
● Might become harder to expand and maintain
25 
Page Factory Example 
@FindBy(how = How.CSS, using="#todo-count strong") 
private WebElement countElementStrong; 
@FindBy(how = How.CSS, using="#todo-count") 
private WebElement countElement; 
@FindBy(how = How.CSS, using="#filters li a") 
List<WebElement> filters; 
@FindBy(how = How.ID, using="clear-completed") 
List<WebElement> clearCompletedAsList; 
@FindBy(how = How.ID, using="clear-completed") 
WebElement clearCompletedButton; 
public ApplicationPageStructuralFactory(WebDriver driver, TodoMVCSite todoMVCSite) 
{ 
PageFactory.initElements(driver, this); 
this.driver = driver; 
...
26 
SlowLoadableComponent 
● Some pages and components need 
synchronisation to wait till they are ready 
– One approach – SlowLoadableComponent adds 
responsibility for waiting, to the page 
● extend SlowLoadableComponent 
● Standard interface for synchronisation on load 
– get() 
● If isLoaded then return this Else load 
● While not loaded{ wait for 200 millseconds} 
– Implement load and isLoaded
27 
Fluent Page Objects 
todoMVC = new ApplicationPageFunctionalFluent( 
driver, todoMVCSite); 
todoMVC.get(); 
todoMVC.enterNewToDo("First Completed Item"). 
and(). 
toggleCompletionOfLastItem(). 
then(). 
enterNewToDo("Still to do this"). 
and(). 
enterNewToDo("Still to do this too"). 
then(). 
filterOnCompleted();
28 
Fluent Page Objects 
● Methods return the page object or other objects 
instead of void 
– void clickDeleteButton(); 
– PageObject clickDeleteButton(); 
● Syntactic sugar methods: 
– and(), then(), also() 
● Can work well at high levels of abstraction and 
when no navigation involved 
● Train Wreck?
Navigation Options 
29 
● Direct in Test: page.get(); page.waitFor(); 
● Instantiate new pages based on test flow 
– Navigation as side-effect, may have to bypass 'get' 
– Loadable pages, non-loadable, support classes 
● Page Object methods might return other Pages 
– e.g. a method on the login page might be 
● MyAccountPage clickLogin(); 
● We might use navigation objects 
– direct, Jump.to(MyAccountPage.class) 
– path based (current page → desired page) 
● Navigate.to(MyAccountPage.class)
30 
Possible Domain Abstractions 
● Logical Objects 
– ToDo 
– ToDoList 
● Physical Objects 
– LocallyStoredToDo 
● Actors 
– User 
● Environment 
– Site 
– Implementation
31 
Page Objects & Domain Objects 
● Instead of 
– todoMVC.enterNewToDo(“New Item”) 
● We could have have 
– ToDoItem newItem = new ToDoItem(“New Item”); 
– todoMVC.enterNewToDo(newItem); 
● See code in DomainBasedTest
32 
Domain Objects That Span Logical 
& Physical 
e.g. User 
● user.createNewToDo(“new item”) 
● user.createNewToDo(newItem) 
● See use in NoAbstractionTest
33 
Sometimes it is possible to over 
think this stuff 
● Don't let thinking about this slow you down 
● Conduct experiments 
● Refactor 
● Rethink if 
– you are maintaining too much 
– your abstraction layer stops you doing stuff 
– you are 'working around' your abstraction layers
34 
Element 
Abstractions
35 
Element Abstraction Example 
public interface Checkbox { 
public boolean isChecked(); 
public Checkbox check(); 
public Checkbox uncheck(); 
public Checkbox toggle(); 
} 
● Would you include 'toggle'? 
https://xp-dev.com/svn/AutomationAbstractions
36 
Element Abstractions 
● Existing support classes: Select, 
● Possible: TextBox, Checkbox, TextBox, File etc. 
● Can enforce Semantics 
– Checkbox: isChecked, check(), uncheck(), toggle() 
– TextBox: clear(), enterText() 
– etc. 
● Pass back from Page Objects into test?
Element Abstraction Pros and Cons 
37 
● May have to create a custom page factory 
● Can help 'restrict' code i.e. check or uncheck, 
rather than click, enforces 'semantics' 
● If you create them... 
– allow return WebElement 
● so that I can go beyond the abstraction layer if I need to. 
Not required if it is just a WebElement wrapper. 
https://xp-dev.com/svn/AutomationAbstractions
38 
Component Abstractions 
● Shared Components/Widgets on the page 
● e.g. 
– VisibleToDoEntry, VisibleToDoList 
– Filters, Footer, Header, etc. 
● Could have 'functional' representation for 
repeated items e.g. login forms 
● Could have 'structural' representation 
● Likely use : page object composition
39 
Component Abstraction Example 
TodoEntry todo = page.getToDoEntryAt(lastItemPosition); 
todo.markCompleted(); 
Instead of 
page.markTodoCompleted(lastItemPosition);
40 
Gherkin as an abstraction layer 
Feature: We can create and edit To Do lists in ToDoMvc 
We want to amend todos in ToDoMVC because that is 
the set of exercises on the abstraction tutorial 
Scenario: Create a ToDo Item 
Given a user opens a blank ToDoMVC page 
When the user creates a todo "new task" 
Then they see 1 todo item on the page 
● Implement steps using highest appropriate 
abstraction layer 
● CucumberJVM as 'DSL implementor' 
● 'Expressibility' vs 'Step Re-use' 
● See todomvc.feature and ToDoMvcSteps
41 
My modeling biases 
● Driver 
– Inject so instantiate any page or component as 
required/desired at any time 
● Explicit Synchronisation 
– To make sure that the desired object is available 
and ready for use (as defined by synchronisation) 
● Navigation 
– Implicit (via taking action e.g. click) 
– Explicit Navigation Object, not in page object 
● Open/jump (via driver.get) 
● To (state model from current, to desired)
42 
My modeling biases 
● Page Objects 
– Physical 
● abstract the 'real world' 
– Components 
● For common features on the page 
– Logical 
● abstract the functionality 
● Sometimes these are entity methods not page objects 
– e.g. user.registers().and().logsin() 
● I tend not to.... 
– abstract WebElements
43 
My modeling biases 
● I tend not to.... 
– abstract WebElements 
– Use inheritence to create a model of the app 
● e.g. MyAppPage extends GenericAppPage 
– Use 3rd party abstractions on top of WebDriver
44 
Are there rights and wrongs? 
● Right / Wrong? 
● Decisions? 
● Project/Team/Organisation Standards? 
Identify your own biases - 
Experiment 
Recognise your decisions
45 
Decisions 
● The 'limits' and overlap of Abstraction Layers 
● Build it now, or 'refactor to' later 
● How much change is anticipated? 
– To which layer? GUI, Business domain, Workflow? 
● Who is working with the automation code? 
– Skill levels? Support needed? 
● How/When with the automation execute?
46 
Other Useful Links 
● Jeff “Cheezy” Morgan – page-object ruby gem, 
data_magic gem and stareast code 
– https://github.com/cheezy?tab=repositories 
● Marcus Merrell 
– Self-Generating Test Artifacts for Selenium/WebDriver 
– https://www.youtube.com/watch?v=mSCFsUOgPpw 
● Anand Ramdeo 
– One Step at a Time 
– https://www.youtube.com/watch?v=dFPgzH_XP1I 
https://xp-dev.com/svn/AutomationAbstractions
47 
Homework 
● Using the code at 
https://xp-dev.com/svn/AutomationAbstractions/ 
– Compare the different implementations under 'main' 
● com.seleniumsimplified.todomvc.page 
– Investigate how the Page Objects delegate to each 
other, and the Domain Objects use Page Objects 
– Examine the 'test' usage of the Page Objects and 
Domain Objects 
– Examine the different navigation approaches
48 
Blogs and Websites 
● CompendiumDev.co.uk 
● SeleniumSimplified.com 
● EvilTester.com 
● JavaForTesters.com 
● Twitter: @eviltester 
Online Training Courses 
● Technical Web Testing 101 
Unow.be/at/techwebtest101 
● Intro to Selenium 
Unow.be/at/startwebdriver 
● Selenium 2 WebDriver API 
Unow.be/at/webdriverapi 
Videos 
youtube.com/user/EviltesterVideos 
Books 
Selenium Simplified 
Unow.be/rc/selsimp 
Java For Testers 
leanpub.com/javaForTesters 
Alan Richardson 
uk.linkedin.com/in/eviltester 
Independent Test Consultant 
& Custom Training 
Contact Alan 
http://compendiumdev.co.uk/contact

More Related Content

What's hot

Automated UI Testing
Automated UI TestingAutomated UI Testing
Automated UI Testing
Mikalai Alimenkou
 
Server-Side Rendering (SSR) with Angular Universal
Server-Side Rendering (SSR) with Angular UniversalServer-Side Rendering (SSR) with Angular Universal
Server-Side Rendering (SSR) with Angular Universal
Katy Slemon
 
Robot framework
Robot frameworkRobot framework
Robot framework
boriau
 
Introduction to react native
Introduction to react nativeIntroduction to react native
Introduction to react native
Dani Akash
 
Clean architecture
Clean architectureClean architecture
Clean architecture
andbed
 
Execute Automation Testing in 3 Steps
Execute Automation Testing in 3 StepsExecute Automation Testing in 3 Steps
Execute Automation Testing in 3 Steps
ExecuteAutomation
 
Selenium 4 with Simon Stewart [Webinar]
Selenium 4 with Simon Stewart [Webinar]Selenium 4 with Simon Stewart [Webinar]
Selenium 4 with Simon Stewart [Webinar]
BrowserStack
 
How to Optimise Continuous Testing
How to Optimise Continuous TestingHow to Optimise Continuous Testing
How to Optimise Continuous Testing
Sauce Labs
 
Angular server side rendering - Strategies & Technics
Angular server side rendering - Strategies & Technics Angular server side rendering - Strategies & Technics
Angular server side rendering - Strategies & Technics
Eliran Eliassy
 
Next.js vs React | what to choose for frontend development_
Next.js vs React | what to choose for frontend development_Next.js vs React | what to choose for frontend development_
Next.js vs React | what to choose for frontend development_
ForceBolt
 
Angular 原始碼探索之Signal 篇
Angular 原始碼探索之Signal 篇Angular 原始碼探索之Signal 篇
Angular 原始碼探索之Signal 篇
志龍 陳
 
Reactive Web Best Practices
Reactive Web Best PracticesReactive Web Best Practices
Reactive Web Best Practices
OutSystems
 
Hybrid framework
Hybrid frameworkHybrid framework
Hybrid framework
Sudhakar Mangi
 
Automation Abstractions: Page Objects and Beyond
Automation Abstractions: Page Objects and BeyondAutomation Abstractions: Page Objects and Beyond
Automation Abstractions: Page Objects and Beyond
TechWell
 
infrastructure as code
infrastructure as codeinfrastructure as code
infrastructure as code
Amazon Web Services
 
Introduction to GraphQL
Introduction to GraphQLIntroduction to GraphQL
Introduction to GraphQL
Amazon Web Services
 
Clean Architecture
Clean ArchitectureClean Architecture
Clean Architecture
Badoo
 
Unit Testing with Jest
Unit Testing with JestUnit Testing with Jest
Unit Testing with Jest
Maayan Glikser
 
Real Life Clean Architecture
Real Life Clean ArchitectureReal Life Clean Architecture
Real Life Clean Architecture
Mattia Battiston
 
Introducing Clean Architecture
Introducing Clean ArchitectureIntroducing Clean Architecture
Introducing Clean Architecture
Roc Boronat
 

What's hot (20)

Automated UI Testing
Automated UI TestingAutomated UI Testing
Automated UI Testing
 
Server-Side Rendering (SSR) with Angular Universal
Server-Side Rendering (SSR) with Angular UniversalServer-Side Rendering (SSR) with Angular Universal
Server-Side Rendering (SSR) with Angular Universal
 
Robot framework
Robot frameworkRobot framework
Robot framework
 
Introduction to react native
Introduction to react nativeIntroduction to react native
Introduction to react native
 
Clean architecture
Clean architectureClean architecture
Clean architecture
 
Execute Automation Testing in 3 Steps
Execute Automation Testing in 3 StepsExecute Automation Testing in 3 Steps
Execute Automation Testing in 3 Steps
 
Selenium 4 with Simon Stewart [Webinar]
Selenium 4 with Simon Stewart [Webinar]Selenium 4 with Simon Stewart [Webinar]
Selenium 4 with Simon Stewart [Webinar]
 
How to Optimise Continuous Testing
How to Optimise Continuous TestingHow to Optimise Continuous Testing
How to Optimise Continuous Testing
 
Angular server side rendering - Strategies & Technics
Angular server side rendering - Strategies & Technics Angular server side rendering - Strategies & Technics
Angular server side rendering - Strategies & Technics
 
Next.js vs React | what to choose for frontend development_
Next.js vs React | what to choose for frontend development_Next.js vs React | what to choose for frontend development_
Next.js vs React | what to choose for frontend development_
 
Angular 原始碼探索之Signal 篇
Angular 原始碼探索之Signal 篇Angular 原始碼探索之Signal 篇
Angular 原始碼探索之Signal 篇
 
Reactive Web Best Practices
Reactive Web Best PracticesReactive Web Best Practices
Reactive Web Best Practices
 
Hybrid framework
Hybrid frameworkHybrid framework
Hybrid framework
 
Automation Abstractions: Page Objects and Beyond
Automation Abstractions: Page Objects and BeyondAutomation Abstractions: Page Objects and Beyond
Automation Abstractions: Page Objects and Beyond
 
infrastructure as code
infrastructure as codeinfrastructure as code
infrastructure as code
 
Introduction to GraphQL
Introduction to GraphQLIntroduction to GraphQL
Introduction to GraphQL
 
Clean Architecture
Clean ArchitectureClean Architecture
Clean Architecture
 
Unit Testing with Jest
Unit Testing with JestUnit Testing with Jest
Unit Testing with Jest
 
Real Life Clean Architecture
Real Life Clean ArchitectureReal Life Clean Architecture
Real Life Clean Architecture
 
Introducing Clean Architecture
Introducing Clean ArchitectureIntroducing Clean Architecture
Introducing Clean Architecture
 

Viewers also liked

Hands on Exploration of Page Objects and Abstraction Layers with Selenium Web...
Hands on Exploration of Page Objects and Abstraction Layers with Selenium Web...Hands on Exploration of Page Objects and Abstraction Layers with Selenium Web...
Hands on Exploration of Page Objects and Abstraction Layers with Selenium Web...
Alan Richardson
 
Using The Page Object Pattern
Using The Page Object PatternUsing The Page Object Pattern
Using The Page Object Pattern
Dante Briones
 
Page Objects Done Right - selenium conference 2014
Page Objects Done Right - selenium conference 2014Page Objects Done Right - selenium conference 2014
Page Objects Done Right - selenium conference 2014
Oren Rubin
 
Beyond Page Objects
Beyond Page ObjectsBeyond Page Objects
Beyond Page Objects
Dante Briones
 
Better Page Object Handling with Loadable Component Pattern
Better Page Object Handling with Loadable Component PatternBetter Page Object Handling with Loadable Component Pattern
Better Page Object Handling with Loadable Component Pattern
Sargis Sargsyan
 
Unbearable Test Code Smell
Unbearable Test Code SmellUnbearable Test Code Smell
Unbearable Test Code Smell
Steven Mak
 
Abstraction Layers Test Management Summit Faciliated Session 2014
Abstraction Layers Test Management Summit Faciliated Session 2014Abstraction Layers Test Management Summit Faciliated Session 2014
Abstraction Layers Test Management Summit Faciliated Session 2014
Alan Richardson
 
Applying Innovation at different levels of abstraction
Applying Innovation at different levels of abstractionApplying Innovation at different levels of abstraction
Applying Innovation at different levels of abstraction
Jathish MJ
 
Innovative Test Automation Solution
Innovative Test Automation SolutionInnovative Test Automation Solution
Innovative Test Automation Solution
Alan Lee White
 
Lessons learned with Bdd: a tutorial
Lessons learned with Bdd: a tutorialLessons learned with Bdd: a tutorial
Lessons learned with Bdd: a tutorial
Alan Richardson
 
Ch1 1
Ch1 1Ch1 1
Is Abstraction the Key to Artificial Intelligence? - Lorenza Saitta
Is Abstraction the Key to Artificial Intelligence? - Lorenza SaittaIs Abstraction the Key to Artificial Intelligence? - Lorenza Saitta
Is Abstraction the Key to Artificial Intelligence? - Lorenza Saitta
WithTheBest
 
Practical Test Automation Deep Dive
Practical Test Automation Deep DivePractical Test Automation Deep Dive
Practical Test Automation Deep Dive
Alan Richardson
 
Test Automation Day 2015 Keynote Alan Richardson - Practical Lessons Learned ...
Test Automation Day 2015 Keynote Alan Richardson - Practical Lessons Learned ...Test Automation Day 2015 Keynote Alan Richardson - Practical Lessons Learned ...
Test Automation Day 2015 Keynote Alan Richardson - Practical Lessons Learned ...
Alan Richardson
 
Multithreading Design Patterns
Multithreading Design PatternsMultithreading Design Patterns
Multithreading Design Patterns
PostSharp Technologies
 
Evil testers guide to technical testing
Evil testers guide to technical testingEvil testers guide to technical testing
Evil testers guide to technical testing
Alan Richardson
 
Perils of Page-Object Pattern
Perils of Page-Object PatternPerils of Page-Object Pattern
Perils of Page-Object Pattern
Anand Bagmar
 
Lessons Learned When Automating
Lessons Learned When AutomatingLessons Learned When Automating
Lessons Learned When Automating
Alan Richardson
 
20041221 gui testing survey
20041221 gui testing survey20041221 gui testing survey
20041221 gui testing survey
Will Shen
 
Why Test Automation Fails
Why Test Automation FailsWhy Test Automation Fails
Why Test Automation Fails
Ranorex
 

Viewers also liked (20)

Hands on Exploration of Page Objects and Abstraction Layers with Selenium Web...
Hands on Exploration of Page Objects and Abstraction Layers with Selenium Web...Hands on Exploration of Page Objects and Abstraction Layers with Selenium Web...
Hands on Exploration of Page Objects and Abstraction Layers with Selenium Web...
 
Using The Page Object Pattern
Using The Page Object PatternUsing The Page Object Pattern
Using The Page Object Pattern
 
Page Objects Done Right - selenium conference 2014
Page Objects Done Right - selenium conference 2014Page Objects Done Right - selenium conference 2014
Page Objects Done Right - selenium conference 2014
 
Beyond Page Objects
Beyond Page ObjectsBeyond Page Objects
Beyond Page Objects
 
Better Page Object Handling with Loadable Component Pattern
Better Page Object Handling with Loadable Component PatternBetter Page Object Handling with Loadable Component Pattern
Better Page Object Handling with Loadable Component Pattern
 
Unbearable Test Code Smell
Unbearable Test Code SmellUnbearable Test Code Smell
Unbearable Test Code Smell
 
Abstraction Layers Test Management Summit Faciliated Session 2014
Abstraction Layers Test Management Summit Faciliated Session 2014Abstraction Layers Test Management Summit Faciliated Session 2014
Abstraction Layers Test Management Summit Faciliated Session 2014
 
Applying Innovation at different levels of abstraction
Applying Innovation at different levels of abstractionApplying Innovation at different levels of abstraction
Applying Innovation at different levels of abstraction
 
Innovative Test Automation Solution
Innovative Test Automation SolutionInnovative Test Automation Solution
Innovative Test Automation Solution
 
Lessons learned with Bdd: a tutorial
Lessons learned with Bdd: a tutorialLessons learned with Bdd: a tutorial
Lessons learned with Bdd: a tutorial
 
Ch1 1
Ch1 1Ch1 1
Ch1 1
 
Is Abstraction the Key to Artificial Intelligence? - Lorenza Saitta
Is Abstraction the Key to Artificial Intelligence? - Lorenza SaittaIs Abstraction the Key to Artificial Intelligence? - Lorenza Saitta
Is Abstraction the Key to Artificial Intelligence? - Lorenza Saitta
 
Practical Test Automation Deep Dive
Practical Test Automation Deep DivePractical Test Automation Deep Dive
Practical Test Automation Deep Dive
 
Test Automation Day 2015 Keynote Alan Richardson - Practical Lessons Learned ...
Test Automation Day 2015 Keynote Alan Richardson - Practical Lessons Learned ...Test Automation Day 2015 Keynote Alan Richardson - Practical Lessons Learned ...
Test Automation Day 2015 Keynote Alan Richardson - Practical Lessons Learned ...
 
Multithreading Design Patterns
Multithreading Design PatternsMultithreading Design Patterns
Multithreading Design Patterns
 
Evil testers guide to technical testing
Evil testers guide to technical testingEvil testers guide to technical testing
Evil testers guide to technical testing
 
Perils of Page-Object Pattern
Perils of Page-Object PatternPerils of Page-Object Pattern
Perils of Page-Object Pattern
 
Lessons Learned When Automating
Lessons Learned When AutomatingLessons Learned When Automating
Lessons Learned When Automating
 
20041221 gui testing survey
20041221 gui testing survey20041221 gui testing survey
20041221 gui testing survey
 
Why Test Automation Fails
Why Test Automation FailsWhy Test Automation Fails
Why Test Automation Fails
 

Similar to Automation Abstraction Layers: Page Objects and Beyond

Three Simple Chords of Alternative PageObjects and Hardcore of LoadableCompon...
Three Simple Chords of Alternative PageObjects and Hardcore of LoadableCompon...Three Simple Chords of Alternative PageObjects and Hardcore of LoadableCompon...
Three Simple Chords of Alternative PageObjects and Hardcore of LoadableCompon...
Iakiv Kramarenko
 
Javascript ui for rest services
Javascript ui for rest servicesJavascript ui for rest services
Javascript ui for rest services
Ioan Eugen Stan
 
Top100summit 谷歌-scott-improve your automated web application testing
Top100summit  谷歌-scott-improve your automated web application testingTop100summit  谷歌-scott-improve your automated web application testing
Top100summit 谷歌-scott-improve your automated web application testing
drewz lin
 
Node.js and Selenium Webdriver, a journey from the Java side
Node.js and Selenium Webdriver, a journey from the Java sideNode.js and Selenium Webdriver, a journey from the Java side
Node.js and Selenium Webdriver, a journey from the Java side
Mek Srunyu Stittri
 
Selenium RC: Automated Testing of Modern Web Applications
Selenium RC: Automated Testing of Modern Web ApplicationsSelenium RC: Automated Testing of Modern Web Applications
Selenium RC: Automated Testing of Modern Web Applications
qooxdoo
 
Easy tests with Selenide and Easyb
Easy tests with Selenide and EasybEasy tests with Selenide and Easyb
Easy tests with Selenide and Easyb
Iakiv Kramarenko
 
Web ui testing
Web ui testingWeb ui testing
Web ui testing
Radim Pavlicek
 
Selenium Testing Training in Bangalore
Selenium Testing Training in BangaloreSelenium Testing Training in Bangalore
Selenium Testing Training in Bangalore
rajkamal560066
 
Automation - web testing with selenium
Automation - web testing with seleniumAutomation - web testing with selenium
Automation - web testing with selenium
Tzirla Rozental
 
Hybrid App using WordPress
Hybrid App using WordPressHybrid App using WordPress
Hybrid App using WordPress
Haim Michael
 
Improving Your Selenium WebDriver Tests - Belgium testing days_2016
Improving Your Selenium WebDriver Tests - Belgium testing days_2016Improving Your Selenium WebDriver Tests - Belgium testing days_2016
Improving Your Selenium WebDriver Tests - Belgium testing days_2016
Roy de Kleijn
 
Javascript unit testing, yes we can e big
Javascript unit testing, yes we can   e bigJavascript unit testing, yes we can   e big
Javascript unit testing, yes we can e big
Andy Peterson
 
The WebView Role in Hybrid Applications
The WebView Role in Hybrid ApplicationsThe WebView Role in Hybrid Applications
The WebView Role in Hybrid Applications
Haim Michael
 
Up and Running with ReactJS
Up and Running with ReactJSUp and Running with ReactJS
Up and Running with ReactJS
Loc Nguyen
 
Web UI test automation instruments
Web UI test automation instrumentsWeb UI test automation instruments
Web UI test automation instruments
Artem Nagornyi
 
One code Web, iOS, Android
One code Web, iOS, AndroidOne code Web, iOS, Android
One code Web, iOS, Android
Artem Marchenko
 
Test strategy for web development
Test strategy for web developmentTest strategy for web development
Test strategy for web development
alice yang
 
Marcin Wasilczyk - Page objects with selenium
Marcin Wasilczyk - Page objects with seleniumMarcin Wasilczyk - Page objects with selenium
Marcin Wasilczyk - Page objects with selenium
Trójmiejska Grupa Testerska
 
Ditching jQuery Madison
Ditching jQuery MadisonDitching jQuery Madison
Ditching jQuery Madison
Hao Luo
 
Ditching JQuery
Ditching JQueryDitching JQuery
Ditching JQuery
howlowck
 

Similar to Automation Abstraction Layers: Page Objects and Beyond (20)

Three Simple Chords of Alternative PageObjects and Hardcore of LoadableCompon...
Three Simple Chords of Alternative PageObjects and Hardcore of LoadableCompon...Three Simple Chords of Alternative PageObjects and Hardcore of LoadableCompon...
Three Simple Chords of Alternative PageObjects and Hardcore of LoadableCompon...
 
Javascript ui for rest services
Javascript ui for rest servicesJavascript ui for rest services
Javascript ui for rest services
 
Top100summit 谷歌-scott-improve your automated web application testing
Top100summit  谷歌-scott-improve your automated web application testingTop100summit  谷歌-scott-improve your automated web application testing
Top100summit 谷歌-scott-improve your automated web application testing
 
Node.js and Selenium Webdriver, a journey from the Java side
Node.js and Selenium Webdriver, a journey from the Java sideNode.js and Selenium Webdriver, a journey from the Java side
Node.js and Selenium Webdriver, a journey from the Java side
 
Selenium RC: Automated Testing of Modern Web Applications
Selenium RC: Automated Testing of Modern Web ApplicationsSelenium RC: Automated Testing of Modern Web Applications
Selenium RC: Automated Testing of Modern Web Applications
 
Easy tests with Selenide and Easyb
Easy tests with Selenide and EasybEasy tests with Selenide and Easyb
Easy tests with Selenide and Easyb
 
Web ui testing
Web ui testingWeb ui testing
Web ui testing
 
Selenium Testing Training in Bangalore
Selenium Testing Training in BangaloreSelenium Testing Training in Bangalore
Selenium Testing Training in Bangalore
 
Automation - web testing with selenium
Automation - web testing with seleniumAutomation - web testing with selenium
Automation - web testing with selenium
 
Hybrid App using WordPress
Hybrid App using WordPressHybrid App using WordPress
Hybrid App using WordPress
 
Improving Your Selenium WebDriver Tests - Belgium testing days_2016
Improving Your Selenium WebDriver Tests - Belgium testing days_2016Improving Your Selenium WebDriver Tests - Belgium testing days_2016
Improving Your Selenium WebDriver Tests - Belgium testing days_2016
 
Javascript unit testing, yes we can e big
Javascript unit testing, yes we can   e bigJavascript unit testing, yes we can   e big
Javascript unit testing, yes we can e big
 
The WebView Role in Hybrid Applications
The WebView Role in Hybrid ApplicationsThe WebView Role in Hybrid Applications
The WebView Role in Hybrid Applications
 
Up and Running with ReactJS
Up and Running with ReactJSUp and Running with ReactJS
Up and Running with ReactJS
 
Web UI test automation instruments
Web UI test automation instrumentsWeb UI test automation instruments
Web UI test automation instruments
 
One code Web, iOS, Android
One code Web, iOS, AndroidOne code Web, iOS, Android
One code Web, iOS, Android
 
Test strategy for web development
Test strategy for web developmentTest strategy for web development
Test strategy for web development
 
Marcin Wasilczyk - Page objects with selenium
Marcin Wasilczyk - Page objects with seleniumMarcin Wasilczyk - Page objects with selenium
Marcin Wasilczyk - Page objects with selenium
 
Ditching jQuery Madison
Ditching jQuery MadisonDitching jQuery Madison
Ditching jQuery Madison
 
Ditching JQuery
Ditching JQueryDitching JQuery
Ditching JQuery
 

More from Alan Richardson

Add More Security To Your Testing and Automating - Saucecon 2021
Add More Security To Your Testing and Automating - Saucecon 2021Add More Security To Your Testing and Automating - Saucecon 2021
Add More Security To Your Testing and Automating - Saucecon 2021
Alan Richardson
 
Automating to Augment Testing
Automating to Augment TestingAutomating to Augment Testing
Automating to Augment Testing
Alan Richardson
 
Open source tools - Test Management Summit - 2009
Open source tools - Test Management Summit - 2009Open source tools - Test Management Summit - 2009
Open source tools - Test Management Summit - 2009
Alan Richardson
 
Automating Tactically vs Strategically SauceCon 2020
Automating Tactically vs Strategically SauceCon 2020Automating Tactically vs Strategically SauceCon 2020
Automating Tactically vs Strategically SauceCon 2020
Alan Richardson
 
The Future of Testing Webinar
The Future of Testing WebinarThe Future of Testing Webinar
The Future of Testing Webinar
Alan Richardson
 
Devfest 2019-slides
Devfest 2019-slidesDevfest 2019-slides
Devfest 2019-slides
Alan Richardson
 
Secrets and Mysteries of Automated Execution Keynote slides
Secrets and Mysteries of Automated Execution Keynote slidesSecrets and Mysteries of Automated Execution Keynote slides
Secrets and Mysteries of Automated Execution Keynote slides
Alan Richardson
 
Automating Pragmatically - Testival 20190604
Automating Pragmatically - Testival 20190604Automating Pragmatically - Testival 20190604
Automating Pragmatically - Testival 20190604
Alan Richardson
 
Joy of Coding Conference 2019 slides - Alan Richardson
Joy of Coding Conference 2019 slides - Alan RichardsonJoy of Coding Conference 2019 slides - Alan Richardson
Joy of Coding Conference 2019 slides - Alan Richardson
Alan Richardson
 
Programming katas for Software Testers - CounterStrings
Programming katas for Software Testers - CounterStringsProgramming katas for Software Testers - CounterStrings
Programming katas for Software Testers - CounterStrings
Alan Richardson
 
Technology Based Testing
Technology Based TestingTechnology Based Testing
Technology Based Testing
Alan Richardson
 
About Consultant Alan Richardson Compendium Developments Evil Tester
About Consultant Alan Richardson Compendium Developments Evil TesterAbout Consultant Alan Richardson Compendium Developments Evil Tester
About Consultant Alan Richardson Compendium Developments Evil Tester
Alan Richardson
 
Shift left-testing
Shift left-testingShift left-testing
Shift left-testing
Alan Richardson
 
Automating and Testing a REST API
Automating and Testing a REST APIAutomating and Testing a REST API
Automating and Testing a REST API
Alan Richardson
 
Technical and Testing Challenges: Using the "Protect The Square" Game
Technical and Testing Challenges: Using the "Protect The Square" GameTechnical and Testing Challenges: Using the "Protect The Square" Game
Technical and Testing Challenges: Using the "Protect The Square" Game
Alan Richardson
 
TDD - Test Driven Development - Java JUnit FizzBuzz
TDD - Test Driven Development - Java JUnit FizzBuzzTDD - Test Driven Development - Java JUnit FizzBuzz
TDD - Test Driven Development - Java JUnit FizzBuzz
Alan Richardson
 
If you want to automate, you learn to code
If you want to automate, you learn to codeIf you want to automate, you learn to code
If you want to automate, you learn to code
Alan Richardson
 
How To Test With Agility
How To Test With AgilityHow To Test With Agility
How To Test With Agility
Alan Richardson
 
Your Automated Execution Does Not Have to be Flaky
Your Automated Execution Does Not Have to be FlakyYour Automated Execution Does Not Have to be Flaky
Your Automated Execution Does Not Have to be Flaky
Alan Richardson
 
What is Testability vs Automatability? How to improve your Software Testing.
What is Testability vs Automatability? How to improve your Software Testing.What is Testability vs Automatability? How to improve your Software Testing.
What is Testability vs Automatability? How to improve your Software Testing.
Alan Richardson
 

More from Alan Richardson (20)

Add More Security To Your Testing and Automating - Saucecon 2021
Add More Security To Your Testing and Automating - Saucecon 2021Add More Security To Your Testing and Automating - Saucecon 2021
Add More Security To Your Testing and Automating - Saucecon 2021
 
Automating to Augment Testing
Automating to Augment TestingAutomating to Augment Testing
Automating to Augment Testing
 
Open source tools - Test Management Summit - 2009
Open source tools - Test Management Summit - 2009Open source tools - Test Management Summit - 2009
Open source tools - Test Management Summit - 2009
 
Automating Tactically vs Strategically SauceCon 2020
Automating Tactically vs Strategically SauceCon 2020Automating Tactically vs Strategically SauceCon 2020
Automating Tactically vs Strategically SauceCon 2020
 
The Future of Testing Webinar
The Future of Testing WebinarThe Future of Testing Webinar
The Future of Testing Webinar
 
Devfest 2019-slides
Devfest 2019-slidesDevfest 2019-slides
Devfest 2019-slides
 
Secrets and Mysteries of Automated Execution Keynote slides
Secrets and Mysteries of Automated Execution Keynote slidesSecrets and Mysteries of Automated Execution Keynote slides
Secrets and Mysteries of Automated Execution Keynote slides
 
Automating Pragmatically - Testival 20190604
Automating Pragmatically - Testival 20190604Automating Pragmatically - Testival 20190604
Automating Pragmatically - Testival 20190604
 
Joy of Coding Conference 2019 slides - Alan Richardson
Joy of Coding Conference 2019 slides - Alan RichardsonJoy of Coding Conference 2019 slides - Alan Richardson
Joy of Coding Conference 2019 slides - Alan Richardson
 
Programming katas for Software Testers - CounterStrings
Programming katas for Software Testers - CounterStringsProgramming katas for Software Testers - CounterStrings
Programming katas for Software Testers - CounterStrings
 
Technology Based Testing
Technology Based TestingTechnology Based Testing
Technology Based Testing
 
About Consultant Alan Richardson Compendium Developments Evil Tester
About Consultant Alan Richardson Compendium Developments Evil TesterAbout Consultant Alan Richardson Compendium Developments Evil Tester
About Consultant Alan Richardson Compendium Developments Evil Tester
 
Shift left-testing
Shift left-testingShift left-testing
Shift left-testing
 
Automating and Testing a REST API
Automating and Testing a REST APIAutomating and Testing a REST API
Automating and Testing a REST API
 
Technical and Testing Challenges: Using the "Protect The Square" Game
Technical and Testing Challenges: Using the "Protect The Square" GameTechnical and Testing Challenges: Using the "Protect The Square" Game
Technical and Testing Challenges: Using the "Protect The Square" Game
 
TDD - Test Driven Development - Java JUnit FizzBuzz
TDD - Test Driven Development - Java JUnit FizzBuzzTDD - Test Driven Development - Java JUnit FizzBuzz
TDD - Test Driven Development - Java JUnit FizzBuzz
 
If you want to automate, you learn to code
If you want to automate, you learn to codeIf you want to automate, you learn to code
If you want to automate, you learn to code
 
How To Test With Agility
How To Test With AgilityHow To Test With Agility
How To Test With Agility
 
Your Automated Execution Does Not Have to be Flaky
Your Automated Execution Does Not Have to be FlakyYour Automated Execution Does Not Have to be Flaky
Your Automated Execution Does Not Have to be Flaky
 
What is Testability vs Automatability? How to improve your Software Testing.
What is Testability vs Automatability? How to improve your Software Testing.What is Testability vs Automatability? How to improve your Software Testing.
What is Testability vs Automatability? How to improve your Software Testing.
 

Recently uploaded

Using Query Store in Azure PostgreSQL to Understand Query Performance
Using Query Store in Azure PostgreSQL to Understand Query PerformanceUsing Query Store in Azure PostgreSQL to Understand Query Performance
Using Query Store in Azure PostgreSQL to Understand Query Performance
Grant Fritchey
 
Energy consumption of Database Management - Florina Jonuzi
Energy consumption of Database Management - Florina JonuziEnergy consumption of Database Management - Florina Jonuzi
Energy consumption of Database Management - Florina Jonuzi
Green Software Development
 
8 Best Automated Android App Testing Tool and Framework in 2024.pdf
8 Best Automated Android App Testing Tool and Framework in 2024.pdf8 Best Automated Android App Testing Tool and Framework in 2024.pdf
8 Best Automated Android App Testing Tool and Framework in 2024.pdf
kalichargn70th171
 
A Comprehensive Guide on Implementing Real-World Mobile Testing Strategies fo...
A Comprehensive Guide on Implementing Real-World Mobile Testing Strategies fo...A Comprehensive Guide on Implementing Real-World Mobile Testing Strategies fo...
A Comprehensive Guide on Implementing Real-World Mobile Testing Strategies fo...
kalichargn70th171
 
Migration From CH 1.0 to CH 2.0 and Mule 4.6 & Java 17 Upgrade.pptx
Migration From CH 1.0 to CH 2.0 and  Mule 4.6 & Java 17 Upgrade.pptxMigration From CH 1.0 to CH 2.0 and  Mule 4.6 & Java 17 Upgrade.pptx
Migration From CH 1.0 to CH 2.0 and Mule 4.6 & Java 17 Upgrade.pptx
ervikas4
 
How Can Hiring A Mobile App Development Company Help Your Business Grow?
How Can Hiring A Mobile App Development Company Help Your Business Grow?How Can Hiring A Mobile App Development Company Help Your Business Grow?
How Can Hiring A Mobile App Development Company Help Your Business Grow?
ToXSL Technologies
 
Unveiling the Advantages of Agile Software Development.pdf
Unveiling the Advantages of Agile Software Development.pdfUnveiling the Advantages of Agile Software Development.pdf
Unveiling the Advantages of Agile Software Development.pdf
brainerhub1
 
WWDC 2024 Keynote Review: For CocoaCoders Austin
WWDC 2024 Keynote Review: For CocoaCoders AustinWWDC 2024 Keynote Review: For CocoaCoders Austin
WWDC 2024 Keynote Review: For CocoaCoders Austin
Patrick Weigel
 
What’s New in Odoo 17 – A Complete Roadmap
What’s New in Odoo 17 – A Complete RoadmapWhat’s New in Odoo 17 – A Complete Roadmap
What’s New in Odoo 17 – A Complete Roadmap
Envertis Software Solutions
 
ppt on the brain chip neuralink.pptx
ppt  on   the brain  chip neuralink.pptxppt  on   the brain  chip neuralink.pptx
ppt on the brain chip neuralink.pptx
Reetu63
 
Preparing Non - Technical Founders for Engaging a Tech Agency
Preparing Non - Technical Founders for Engaging  a  Tech AgencyPreparing Non - Technical Founders for Engaging  a  Tech Agency
Preparing Non - Technical Founders for Engaging a Tech Agency
ISH Technologies
 
Webinar On-Demand: Using Flutter for Embedded
Webinar On-Demand: Using Flutter for EmbeddedWebinar On-Demand: Using Flutter for Embedded
Webinar On-Demand: Using Flutter for Embedded
ICS
 
Microservice Teams - How the cloud changes the way we work
Microservice Teams - How the cloud changes the way we workMicroservice Teams - How the cloud changes the way we work
Microservice Teams - How the cloud changes the way we work
Sven Peters
 
INTRODUCTION TO AI CLASSICAL THEORY TARGETED EXAMPLES
INTRODUCTION TO AI CLASSICAL THEORY TARGETED EXAMPLESINTRODUCTION TO AI CLASSICAL THEORY TARGETED EXAMPLES
INTRODUCTION TO AI CLASSICAL THEORY TARGETED EXAMPLES
anfaltahir1010
 
ACE - Team 24 Wrapup event at ahmedabad.
ACE - Team 24 Wrapup event at ahmedabad.ACE - Team 24 Wrapup event at ahmedabad.
ACE - Team 24 Wrapup event at ahmedabad.
Maitrey Patel
 
一比一原版(UMN毕业证)明尼苏达大学毕业证如何办理
一比一原版(UMN毕业证)明尼苏达大学毕业证如何办理一比一原版(UMN毕业证)明尼苏达大学毕业证如何办理
一比一原版(UMN毕业证)明尼苏达大学毕业证如何办理
dakas1
 
E-Invoicing Implementation: A Step-by-Step Guide for Saudi Arabian Companies
E-Invoicing Implementation: A Step-by-Step Guide for Saudi Arabian CompaniesE-Invoicing Implementation: A Step-by-Step Guide for Saudi Arabian Companies
E-Invoicing Implementation: A Step-by-Step Guide for Saudi Arabian Companies
Quickdice ERP
 
J-Spring 2024 - Going serverless with Quarkus, GraalVM native images and AWS ...
J-Spring 2024 - Going serverless with Quarkus, GraalVM native images and AWS ...J-Spring 2024 - Going serverless with Quarkus, GraalVM native images and AWS ...
J-Spring 2024 - Going serverless with Quarkus, GraalVM native images and AWS ...
Bert Jan Schrijver
 
Oracle 23c New Features For DBAs and Developers.pptx
Oracle 23c New Features For DBAs and Developers.pptxOracle 23c New Features For DBAs and Developers.pptx
Oracle 23c New Features For DBAs and Developers.pptx
Remote DBA Services
 
Project Management: The Role of Project Dashboards.pdf
Project Management: The Role of Project Dashboards.pdfProject Management: The Role of Project Dashboards.pdf
Project Management: The Role of Project Dashboards.pdf
Karya Keeper
 

Recently uploaded (20)

Using Query Store in Azure PostgreSQL to Understand Query Performance
Using Query Store in Azure PostgreSQL to Understand Query PerformanceUsing Query Store in Azure PostgreSQL to Understand Query Performance
Using Query Store in Azure PostgreSQL to Understand Query Performance
 
Energy consumption of Database Management - Florina Jonuzi
Energy consumption of Database Management - Florina JonuziEnergy consumption of Database Management - Florina Jonuzi
Energy consumption of Database Management - Florina Jonuzi
 
8 Best Automated Android App Testing Tool and Framework in 2024.pdf
8 Best Automated Android App Testing Tool and Framework in 2024.pdf8 Best Automated Android App Testing Tool and Framework in 2024.pdf
8 Best Automated Android App Testing Tool and Framework in 2024.pdf
 
A Comprehensive Guide on Implementing Real-World Mobile Testing Strategies fo...
A Comprehensive Guide on Implementing Real-World Mobile Testing Strategies fo...A Comprehensive Guide on Implementing Real-World Mobile Testing Strategies fo...
A Comprehensive Guide on Implementing Real-World Mobile Testing Strategies fo...
 
Migration From CH 1.0 to CH 2.0 and Mule 4.6 & Java 17 Upgrade.pptx
Migration From CH 1.0 to CH 2.0 and  Mule 4.6 & Java 17 Upgrade.pptxMigration From CH 1.0 to CH 2.0 and  Mule 4.6 & Java 17 Upgrade.pptx
Migration From CH 1.0 to CH 2.0 and Mule 4.6 & Java 17 Upgrade.pptx
 
How Can Hiring A Mobile App Development Company Help Your Business Grow?
How Can Hiring A Mobile App Development Company Help Your Business Grow?How Can Hiring A Mobile App Development Company Help Your Business Grow?
How Can Hiring A Mobile App Development Company Help Your Business Grow?
 
Unveiling the Advantages of Agile Software Development.pdf
Unveiling the Advantages of Agile Software Development.pdfUnveiling the Advantages of Agile Software Development.pdf
Unveiling the Advantages of Agile Software Development.pdf
 
WWDC 2024 Keynote Review: For CocoaCoders Austin
WWDC 2024 Keynote Review: For CocoaCoders AustinWWDC 2024 Keynote Review: For CocoaCoders Austin
WWDC 2024 Keynote Review: For CocoaCoders Austin
 
What’s New in Odoo 17 – A Complete Roadmap
What’s New in Odoo 17 – A Complete RoadmapWhat’s New in Odoo 17 – A Complete Roadmap
What’s New in Odoo 17 – A Complete Roadmap
 
ppt on the brain chip neuralink.pptx
ppt  on   the brain  chip neuralink.pptxppt  on   the brain  chip neuralink.pptx
ppt on the brain chip neuralink.pptx
 
Preparing Non - Technical Founders for Engaging a Tech Agency
Preparing Non - Technical Founders for Engaging  a  Tech AgencyPreparing Non - Technical Founders for Engaging  a  Tech Agency
Preparing Non - Technical Founders for Engaging a Tech Agency
 
Webinar On-Demand: Using Flutter for Embedded
Webinar On-Demand: Using Flutter for EmbeddedWebinar On-Demand: Using Flutter for Embedded
Webinar On-Demand: Using Flutter for Embedded
 
Microservice Teams - How the cloud changes the way we work
Microservice Teams - How the cloud changes the way we workMicroservice Teams - How the cloud changes the way we work
Microservice Teams - How the cloud changes the way we work
 
INTRODUCTION TO AI CLASSICAL THEORY TARGETED EXAMPLES
INTRODUCTION TO AI CLASSICAL THEORY TARGETED EXAMPLESINTRODUCTION TO AI CLASSICAL THEORY TARGETED EXAMPLES
INTRODUCTION TO AI CLASSICAL THEORY TARGETED EXAMPLES
 
ACE - Team 24 Wrapup event at ahmedabad.
ACE - Team 24 Wrapup event at ahmedabad.ACE - Team 24 Wrapup event at ahmedabad.
ACE - Team 24 Wrapup event at ahmedabad.
 
一比一原版(UMN毕业证)明尼苏达大学毕业证如何办理
一比一原版(UMN毕业证)明尼苏达大学毕业证如何办理一比一原版(UMN毕业证)明尼苏达大学毕业证如何办理
一比一原版(UMN毕业证)明尼苏达大学毕业证如何办理
 
E-Invoicing Implementation: A Step-by-Step Guide for Saudi Arabian Companies
E-Invoicing Implementation: A Step-by-Step Guide for Saudi Arabian CompaniesE-Invoicing Implementation: A Step-by-Step Guide for Saudi Arabian Companies
E-Invoicing Implementation: A Step-by-Step Guide for Saudi Arabian Companies
 
J-Spring 2024 - Going serverless with Quarkus, GraalVM native images and AWS ...
J-Spring 2024 - Going serverless with Quarkus, GraalVM native images and AWS ...J-Spring 2024 - Going serverless with Quarkus, GraalVM native images and AWS ...
J-Spring 2024 - Going serverless with Quarkus, GraalVM native images and AWS ...
 
Oracle 23c New Features For DBAs and Developers.pptx
Oracle 23c New Features For DBAs and Developers.pptxOracle 23c New Features For DBAs and Developers.pptx
Oracle 23c New Features For DBAs and Developers.pptx
 
Project Management: The Role of Project Dashboards.pdf
Project Management: The Role of Project Dashboards.pdfProject Management: The Role of Project Dashboards.pdf
Project Management: The Role of Project Dashboards.pdf
 

Automation Abstraction Layers: Page Objects and Beyond

  • 1. 1 Automation Abstractions: Page Objects and Beyond Alan Richardson @eviltester https://xp-dev.com/svn/AutomationAbstractions www.SeleniumSimplified.com www.EvilTester.com www.CompendiumDev.co.uk www.JavaForTesters.com
  • 2. 2 What is Abstraction? ● Modelling ● Separation of concerns ● Logical vs Physical ● Functional vs Structural ● Interfaces vs Implementations ● Data / Entities / Persistence ● Functionality / Task Flow ● Goals / Strategies ● Layers – GUI, DB, HTTP ● Etc.
  • 3. “I must create a system. or be enslav'd by another Mans; I will not reason & compare: my business is to create” William Blake, 1820 Jerusalem: The Emanation of the Giant Albion 3 http://www.blakearchive.org/exist/blake/archive/object.xq?objectid=jerusalem.e.illbk.10&java=no
  • 4. https://xp-dev.com/svn/AutomationAbstractions 4 Example Test Without Abstraction @Before public void startDriver(){ @Test public void canCreateAToDoWithNoAbstraction(){ driver.get("http://todomvc.com/architecture-examples/backbone/"); int originalNumberOfTodos = driver.findElements( By.cssSelector("ul#todo-list li")).size(); WebElement createTodo = driver.findElement(By.id("new-todo")); createTodo.click(); createTodo.sendKeys("new task"); createTodo.sendKeys(Keys.ENTER); assertThat(driver.findElement( By.id("filters")).isDisplayed(), is(true)); int newToDos = driver.findElements( By.cssSelector("ul#todo-list li")).size(); assertThat(newToDos, greaterThan(originalNumberOfTodos)); } driver = new FirefoxDriver(); } @After public void stopDriver(){ driver.close(); driver.quit(); } NoAbstractionTest.java
  • 5. But this does use some abstraction layers LLooccaattoorr A Abbssttrraaccttioionns WebElement Generic Element Abstraction 5 Example Test Without Abstraction @Before public void startDriver(){ WebDriver Generic Browser Abstraction @Test public void canCreateAToDoWithNoAbstraction(){ Firefox Browser Abstraction driver.get("http://todomvc.com/architecture-examples/backbone/"); int originalNumberOfTodos = driver.findElements( By.cssSelector("ul#todo-list li")).size(); WebElement createTodo = driver.findElement(By.id("new-todo")); createTodo.click(); createTodo.sendKeys("new task"); createTodo.sendKeys(Keys.ENTER); assertThat(driver.findElement( By.id("filters")).isDisplayed(), is(true)); int newToDos = driver.findElements( Manipulation Abstractions By.cssSelector("ul#todo-list li")).size(); assertThat(newToDos, greaterThan(originalNumberOfTodos)); } driver = new FirefoxDriver(); } @After public void stopDriver(){ driver.close(); driver.quit(); } NoAbstractionTest.java
  • 6. 6 WebDriver provides abstractions ● Browser ● DOM ● Web Element Tool vendors gain value from generic abstractions. You gain value from 'domain' abstractions.
  • 7. 7 Example Test With Abstraction @Before public void startDriver(){ @Test public void canCreateAToDoWithAbstraction(){ TodoMVCUser user = new TodoMVCUser(driver, new TodoMVCSite()); user.opensApplication().and().createNewToDo("new task"); ApplicationPageFunctional page = new ApplicationPageFunctional(driver, new TodoMVCSite()); assertThat(page.getCountOfTodoDoItems(), is(1)); assertThat(page.isFooterVisible(), is(true)); } driver = new FirefoxDriver(); } @After public void stopDriver(){ driver.close(); driver.quit(); } NoAbstractionTest.java
  • 8. 8 Why Abstraction? ● Change implementations ● Single Responsibility – only changes when necessary ● Makes automation readable and maintainable ● We can unit test some of our test code ● etc. https://xp-dev.com/svn/AutomationAbstractions
  • 9. 9 Some Abstraction Layer Categories 1) Data – Generic Data Abstractions e.g. email, postcode 2) Physical – Physical layout of your application e.g. pages, components – Navigation across pages 3) Domain – Your application Entities domain e.g. user, account 4) Logical – User actions, workflows
  • 10. 10 Common Automation Abstractions ● Page Objects: pages, components, widgets ● Dom Element Abstractions: select, textbox, etc. ● Domain Objects: user, account, order ● Gherkin (Given/When/And/Then) ● Domain Specific Languages: code, keywords ● ... https://xp-dev.com/svn/AutomationAbstractions
  • 11. 11 Abstraction != Implementation ● Abstraction != Tool / Framework / Implementation ● Gherkin != Cucumber ● Page Object != Page Factory / Slow Loadable ● DSL != Keyword Driven If we want to get good at abstraction then we need to model, split apart, make the relationships clear, and be aware of our options.
  • 12. 12 Page Objects ● The most obvious automation abstraction ● What is it? – A page? A Component? ● Do web applications still have pages?
  • 13. A Page Object that abstracts a Page 13 ● Often has methods for – Opening the page – Accessing elements – Doing stuff, and navigating as a side-effect – Logical high level functionality e.g. login – Low level physical functionality e.g. typeUsername, clickLoginButton Should a Page Object be responsible for all of this?
  • 14. 14 Page Object Design Decisions ● What methods does it have? – Functional ● login(username, password), ● loginAs(user) – Structural ● enterName(username), enterPassword(password), clickLogin(), submitLoginForm(username, password) ● Does it expose elements or not? – public WebElement loginButton; – public WebElement getLoginButton(); – public clickLoginButton();
  • 15. 15 Page Object Functionality Approaches ● Expose WebElements Directly – Leads to WebElement Abstractions – public TextField userNameField; ● Hide WebElements behind physical functional methods e.g. typeUserName("bob"); ● Logical helper methods e.g. loginAs(name,pass) ● Layers of Page Objects – Physical – Logical
  • 16. 16 Navigation Design Decisions ● Does a Page Object return other pages? public IssueListPage submit(){ driver.findElement(By.id(“submit”)).click(); return new IssueListPage(driver); } ● Or Navigate implicitly after interactions ● Or have navigation objects
  • 17. 17 Implicit or Explicit Wait? ● Implicit Wait driver.manage().timeouts(). implicitlyWait(15L, TimeUnit.SECONDS); assertThat(driver.findElement( By.id("filters")).isDisplayed() , is(true)); ● Explicit Wait driver.manage().timeouts(). implicitlyWait(0L, TimeUnit.SECONDS); WebDriverWait wait = new WebDriverWait(driver,15); wait.until(ExpectedConditions.elementToBeClickable (By.id("filters"))); Example: 'NoAbstractionTest.java'
  • 18. 18 Implementing Page Objects ● POJO – Plain object, driver in constructor, methods use driver.<method> ● Page Factory – Annotated elements, lazy instantiation via reflection ● LoadableComponent – Common interface (load, isLoaded), isLoaded throws Error ● SlowLoadableComponent – Common interface, waits for on isLoaded ● Other approaches?
  • 19. 19 Example Implementations https://xp-dev.com/svn/AutomationAbstractions
  • 20. 20 POJO ● 'ApplicationPage.java' – Used in 'SequentialCreationOfTest.java' – Not much refactoring in the example ● Simple Class ● WebDriver passed to constructor ● Composition of any components ● e.g. – com.seleniumsimplified.todomvc.page.pojo – 'ApplicationPage.java' ● Not much refactoring in the example
  • 22. 22 Functional vs Structural ● Functional – loginAs(username, password) ● Structural – enterUsername – enterPassword – clickLoginButton – submitLoginForm(username, password)
  • 23. 23 Functional Vs Structural Example ● One way of answering “what methods to put on a page object” – Is it functional / behavioural? – Is it structural / Physical? ● Functional 'uses' Structural implementation ● Why? – Sometimes it is just a naming difference – Handling exceptions in functional but not structural – Higher level methods in Functional – Different concepts e.g. deleteLastItem
  • 24. 24 Page Factory ● Annotate fields with @FindBy ● Instantiate in constructor using PageFactory.initElements – Can create your own page factory initialiser ● Avoids boilerplate accessor methods ● Fast to create Page Objects ● Might become harder to expand and maintain
  • 25. 25 Page Factory Example @FindBy(how = How.CSS, using="#todo-count strong") private WebElement countElementStrong; @FindBy(how = How.CSS, using="#todo-count") private WebElement countElement; @FindBy(how = How.CSS, using="#filters li a") List<WebElement> filters; @FindBy(how = How.ID, using="clear-completed") List<WebElement> clearCompletedAsList; @FindBy(how = How.ID, using="clear-completed") WebElement clearCompletedButton; public ApplicationPageStructuralFactory(WebDriver driver, TodoMVCSite todoMVCSite) { PageFactory.initElements(driver, this); this.driver = driver; ...
  • 26. 26 SlowLoadableComponent ● Some pages and components need synchronisation to wait till they are ready – One approach – SlowLoadableComponent adds responsibility for waiting, to the page ● extend SlowLoadableComponent ● Standard interface for synchronisation on load – get() ● If isLoaded then return this Else load ● While not loaded{ wait for 200 millseconds} – Implement load and isLoaded
  • 27. 27 Fluent Page Objects todoMVC = new ApplicationPageFunctionalFluent( driver, todoMVCSite); todoMVC.get(); todoMVC.enterNewToDo("First Completed Item"). and(). toggleCompletionOfLastItem(). then(). enterNewToDo("Still to do this"). and(). enterNewToDo("Still to do this too"). then(). filterOnCompleted();
  • 28. 28 Fluent Page Objects ● Methods return the page object or other objects instead of void – void clickDeleteButton(); – PageObject clickDeleteButton(); ● Syntactic sugar methods: – and(), then(), also() ● Can work well at high levels of abstraction and when no navigation involved ● Train Wreck?
  • 29. Navigation Options 29 ● Direct in Test: page.get(); page.waitFor(); ● Instantiate new pages based on test flow – Navigation as side-effect, may have to bypass 'get' – Loadable pages, non-loadable, support classes ● Page Object methods might return other Pages – e.g. a method on the login page might be ● MyAccountPage clickLogin(); ● We might use navigation objects – direct, Jump.to(MyAccountPage.class) – path based (current page → desired page) ● Navigate.to(MyAccountPage.class)
  • 30. 30 Possible Domain Abstractions ● Logical Objects – ToDo – ToDoList ● Physical Objects – LocallyStoredToDo ● Actors – User ● Environment – Site – Implementation
  • 31. 31 Page Objects & Domain Objects ● Instead of – todoMVC.enterNewToDo(“New Item”) ● We could have have – ToDoItem newItem = new ToDoItem(“New Item”); – todoMVC.enterNewToDo(newItem); ● See code in DomainBasedTest
  • 32. 32 Domain Objects That Span Logical & Physical e.g. User ● user.createNewToDo(“new item”) ● user.createNewToDo(newItem) ● See use in NoAbstractionTest
  • 33. 33 Sometimes it is possible to over think this stuff ● Don't let thinking about this slow you down ● Conduct experiments ● Refactor ● Rethink if – you are maintaining too much – your abstraction layer stops you doing stuff – you are 'working around' your abstraction layers
  • 35. 35 Element Abstraction Example public interface Checkbox { public boolean isChecked(); public Checkbox check(); public Checkbox uncheck(); public Checkbox toggle(); } ● Would you include 'toggle'? https://xp-dev.com/svn/AutomationAbstractions
  • 36. 36 Element Abstractions ● Existing support classes: Select, ● Possible: TextBox, Checkbox, TextBox, File etc. ● Can enforce Semantics – Checkbox: isChecked, check(), uncheck(), toggle() – TextBox: clear(), enterText() – etc. ● Pass back from Page Objects into test?
  • 37. Element Abstraction Pros and Cons 37 ● May have to create a custom page factory ● Can help 'restrict' code i.e. check or uncheck, rather than click, enforces 'semantics' ● If you create them... – allow return WebElement ● so that I can go beyond the abstraction layer if I need to. Not required if it is just a WebElement wrapper. https://xp-dev.com/svn/AutomationAbstractions
  • 38. 38 Component Abstractions ● Shared Components/Widgets on the page ● e.g. – VisibleToDoEntry, VisibleToDoList – Filters, Footer, Header, etc. ● Could have 'functional' representation for repeated items e.g. login forms ● Could have 'structural' representation ● Likely use : page object composition
  • 39. 39 Component Abstraction Example TodoEntry todo = page.getToDoEntryAt(lastItemPosition); todo.markCompleted(); Instead of page.markTodoCompleted(lastItemPosition);
  • 40. 40 Gherkin as an abstraction layer Feature: We can create and edit To Do lists in ToDoMvc We want to amend todos in ToDoMVC because that is the set of exercises on the abstraction tutorial Scenario: Create a ToDo Item Given a user opens a blank ToDoMVC page When the user creates a todo "new task" Then they see 1 todo item on the page ● Implement steps using highest appropriate abstraction layer ● CucumberJVM as 'DSL implementor' ● 'Expressibility' vs 'Step Re-use' ● See todomvc.feature and ToDoMvcSteps
  • 41. 41 My modeling biases ● Driver – Inject so instantiate any page or component as required/desired at any time ● Explicit Synchronisation – To make sure that the desired object is available and ready for use (as defined by synchronisation) ● Navigation – Implicit (via taking action e.g. click) – Explicit Navigation Object, not in page object ● Open/jump (via driver.get) ● To (state model from current, to desired)
  • 42. 42 My modeling biases ● Page Objects – Physical ● abstract the 'real world' – Components ● For common features on the page – Logical ● abstract the functionality ● Sometimes these are entity methods not page objects – e.g. user.registers().and().logsin() ● I tend not to.... – abstract WebElements
  • 43. 43 My modeling biases ● I tend not to.... – abstract WebElements – Use inheritence to create a model of the app ● e.g. MyAppPage extends GenericAppPage – Use 3rd party abstractions on top of WebDriver
  • 44. 44 Are there rights and wrongs? ● Right / Wrong? ● Decisions? ● Project/Team/Organisation Standards? Identify your own biases - Experiment Recognise your decisions
  • 45. 45 Decisions ● The 'limits' and overlap of Abstraction Layers ● Build it now, or 'refactor to' later ● How much change is anticipated? – To which layer? GUI, Business domain, Workflow? ● Who is working with the automation code? – Skill levels? Support needed? ● How/When with the automation execute?
  • 46. 46 Other Useful Links ● Jeff “Cheezy” Morgan – page-object ruby gem, data_magic gem and stareast code – https://github.com/cheezy?tab=repositories ● Marcus Merrell – Self-Generating Test Artifacts for Selenium/WebDriver – https://www.youtube.com/watch?v=mSCFsUOgPpw ● Anand Ramdeo – One Step at a Time – https://www.youtube.com/watch?v=dFPgzH_XP1I https://xp-dev.com/svn/AutomationAbstractions
  • 47. 47 Homework ● Using the code at https://xp-dev.com/svn/AutomationAbstractions/ – Compare the different implementations under 'main' ● com.seleniumsimplified.todomvc.page – Investigate how the Page Objects delegate to each other, and the Domain Objects use Page Objects – Examine the 'test' usage of the Page Objects and Domain Objects – Examine the different navigation approaches
  • 48. 48 Blogs and Websites ● CompendiumDev.co.uk ● SeleniumSimplified.com ● EvilTester.com ● JavaForTesters.com ● Twitter: @eviltester Online Training Courses ● Technical Web Testing 101 Unow.be/at/techwebtest101 ● Intro to Selenium Unow.be/at/startwebdriver ● Selenium 2 WebDriver API Unow.be/at/webdriverapi Videos youtube.com/user/EviltesterVideos Books Selenium Simplified Unow.be/rc/selsimp Java For Testers leanpub.com/javaForTesters Alan Richardson uk.linkedin.com/in/eviltester Independent Test Consultant & Custom Training Contact Alan http://compendiumdev.co.uk/contact