SlideShare une entreprise Scribd logo
1  sur  48
Télécharger pour lire hors ligne
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

Contenu connexe

Tendances

Spring boot - an introduction
Spring boot - an introductionSpring boot - an introduction
Spring boot - an introductionJonathan Holloway
 
What Is Spring Framework In Java | Spring Framework Tutorial For Beginners Wi...
What Is Spring Framework In Java | Spring Framework Tutorial For Beginners Wi...What Is Spring Framework In Java | Spring Framework Tutorial For Beginners Wi...
What Is Spring Framework In Java | Spring Framework Tutorial For Beginners Wi...Edureka!
 
Spring Boot & Actuators
Spring Boot & ActuatorsSpring Boot & Actuators
Spring Boot & ActuatorsVMware Tanzu
 
Hibernate Presentation
Hibernate  PresentationHibernate  Presentation
Hibernate Presentationguest11106b
 
今さら聞けないDiとspring
今さら聞けないDiとspring今さら聞けないDiとspring
今さら聞けないDiとspring土岐 孝平
 
React + Redux + TypeScript === ♥
React + Redux + TypeScript === ♥React + Redux + TypeScript === ♥
React + Redux + TypeScript === ♥Remo Jansen
 
Exploring the power of Gradle in android studio - Basics & Beyond
Exploring the power of Gradle in android studio - Basics & BeyondExploring the power of Gradle in android studio - Basics & Beyond
Exploring the power of Gradle in android studio - Basics & BeyondKaushal Dhruw
 
React JS: A Secret Preview
React JS: A Secret PreviewReact JS: A Secret Preview
React JS: A Secret Previewvaluebound
 
Testes E2E em Cypress com JS
Testes E2E em Cypress com JSTestes E2E em Cypress com JS
Testes E2E em Cypress com JSNàtali Cabral
 

Tendances (20)

Spring boot - an introduction
Spring boot - an introductionSpring boot - an introduction
Spring boot - an introduction
 
Dropwizard
DropwizardDropwizard
Dropwizard
 
Flutter introduction
Flutter introductionFlutter introduction
Flutter introduction
 
Flutter for web
Flutter for webFlutter for web
Flutter for web
 
Spring annotation
Spring annotationSpring annotation
Spring annotation
 
DeviceOwnerのお話
DeviceOwnerのお話DeviceOwnerのお話
DeviceOwnerのお話
 
What Is Spring Framework In Java | Spring Framework Tutorial For Beginners Wi...
What Is Spring Framework In Java | Spring Framework Tutorial For Beginners Wi...What Is Spring Framework In Java | Spring Framework Tutorial For Beginners Wi...
What Is Spring Framework In Java | Spring Framework Tutorial For Beginners Wi...
 
Flutter
FlutterFlutter
Flutter
 
Introduction to React JS
Introduction to React JSIntroduction to React JS
Introduction to React JS
 
Spring Boot & Actuators
Spring Boot & ActuatorsSpring Boot & Actuators
Spring Boot & Actuators
 
Hibernate Presentation
Hibernate  PresentationHibernate  Presentation
Hibernate Presentation
 
Basic Python Django
Basic Python DjangoBasic Python Django
Basic Python Django
 
今さら聞けないDiとspring
今さら聞けないDiとspring今さら聞けないDiとspring
今さら聞けないDiとspring
 
React + Redux + TypeScript === ♥
React + Redux + TypeScript === ♥React + Redux + TypeScript === ♥
React + Redux + TypeScript === ♥
 
Exploring the power of Gradle in android studio - Basics & Beyond
Exploring the power of Gradle in android studio - Basics & BeyondExploring the power of Gradle in android studio - Basics & Beyond
Exploring the power of Gradle in android studio - Basics & Beyond
 
React Native
React NativeReact Native
React Native
 
Rest api and-crud-api
Rest api and-crud-apiRest api and-crud-api
Rest api and-crud-api
 
Spring Framework
Spring FrameworkSpring Framework
Spring Framework
 
React JS: A Secret Preview
React JS: A Secret PreviewReact JS: A Secret Preview
React JS: A Secret Preview
 
Testes E2E em Cypress com JS
Testes E2E em Cypress com JSTestes E2E em Cypress com JS
Testes E2E em Cypress com JS
 

En vedette

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 PatternDante 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 2014Oren Rubin
 
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 PatternSargis Sargsyan
 
Unbearable Test Code Smell
Unbearable Test Code SmellUnbearable Test Code Smell
Unbearable Test Code SmellSteven 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 2014Alan 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 abstractionJathish MJ
 
Innovative Test Automation Solution
Innovative Test Automation SolutionInnovative Test Automation Solution
Innovative Test Automation SolutionAlan Lee White
 
Lessons learned with Bdd: a tutorial
Lessons learned with Bdd: a tutorialLessons learned with Bdd: a tutorial
Lessons learned with Bdd: a tutorialAlan Richardson
 
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 SaittaWithTheBest
 
Practical Test Automation Deep Dive
Practical Test Automation Deep DivePractical Test Automation Deep Dive
Practical Test Automation Deep DiveAlan 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
 
Evil testers guide to technical testing
Evil testers guide to technical testingEvil testers guide to technical testing
Evil testers guide to technical testingAlan Richardson
 
Perils of Page-Object Pattern
Perils of Page-Object PatternPerils of Page-Object Pattern
Perils of Page-Object PatternAnand Bagmar
 
Lessons Learned When Automating
Lessons Learned When AutomatingLessons Learned When Automating
Lessons Learned When AutomatingAlan Richardson
 
20041221 gui testing survey
20041221 gui testing survey20041221 gui testing survey
20041221 gui testing surveyWill Shen
 
Why Test Automation Fails
Why Test Automation FailsWhy Test Automation Fails
Why Test Automation FailsRanorex
 

En vedette (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
 

Similaire à 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 servicesIoan 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 testingdrewz 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 sideMek 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 Applicationsqooxdoo
 
Easy tests with Selenide and Easyb
Easy tests with Selenide and EasybEasy tests with Selenide and Easyb
Easy tests with Selenide and EasybIakiv Kramarenko
 
Selenium Testing Training in Bangalore
Selenium Testing Training in BangaloreSelenium Testing Training in Bangalore
Selenium Testing Training in Bangalorerajkamal560066
 
Automation - web testing with selenium
Automation - web testing with seleniumAutomation - web testing with selenium
Automation - web testing with seleniumTzirla Rozental
 
Hybrid App using WordPress
Hybrid App using WordPressHybrid App using WordPress
Hybrid App using WordPressHaim 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_2016Roy 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 bigAndy Peterson
 
The WebView Role in Hybrid Applications
The WebView Role in Hybrid ApplicationsThe WebView Role in Hybrid Applications
The WebView Role in Hybrid ApplicationsHaim Michael
 
Up and Running with ReactJS
Up and Running with ReactJSUp and Running with ReactJS
Up and Running with ReactJSLoc Nguyen
 
Web UI test automation instruments
Web UI test automation instrumentsWeb UI test automation instruments
Web UI test automation instrumentsArtem Nagornyi
 
One code Web, iOS, Android
One code Web, iOS, AndroidOne code Web, iOS, Android
One code Web, iOS, AndroidArtem Marchenko
 
Test strategy for web development
Test strategy for web developmentTest strategy for web development
Test strategy for web developmentalice yang
 
Ditching jQuery Madison
Ditching jQuery MadisonDitching jQuery Madison
Ditching jQuery MadisonHao Luo
 
Ditching JQuery
Ditching JQueryDitching JQuery
Ditching JQueryhowlowck
 

Similaire à 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
 

Plus de 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 2021Alan Richardson
 
Automating to Augment Testing
Automating to Augment TestingAutomating to Augment Testing
Automating to Augment TestingAlan 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 - 2009Alan Richardson
 
Automating Tactically vs Strategically SauceCon 2020
Automating Tactically vs Strategically SauceCon 2020Automating Tactically vs Strategically SauceCon 2020
Automating Tactically vs Strategically SauceCon 2020Alan Richardson
 
The Future of Testing Webinar
The Future of Testing WebinarThe Future of Testing Webinar
The Future of Testing WebinarAlan 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 slidesAlan Richardson
 
Automating Pragmatically - Testival 20190604
Automating Pragmatically - Testival 20190604Automating Pragmatically - Testival 20190604
Automating Pragmatically - Testival 20190604Alan 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 RichardsonAlan Richardson
 
Programming katas for Software Testers - CounterStrings
Programming katas for Software Testers - CounterStringsProgramming katas for Software Testers - CounterStrings
Programming katas for Software Testers - CounterStringsAlan Richardson
 
Technology Based Testing
Technology Based TestingTechnology Based Testing
Technology Based TestingAlan 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 TesterAlan Richardson
 
Automating and Testing a REST API
Automating and Testing a REST APIAutomating and Testing a REST API
Automating and Testing a REST APIAlan 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" GameAlan 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 FizzBuzzAlan 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 codeAlan Richardson
 
How To Test With Agility
How To Test With AgilityHow To Test With Agility
How To Test With AgilityAlan 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 FlakyAlan 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
 

Plus de 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.
 

Dernier

How to submit a standout Adobe Champion Application
How to submit a standout Adobe Champion ApplicationHow to submit a standout Adobe Champion Application
How to submit a standout Adobe Champion ApplicationBradBedford3
 
Alfresco TTL#157 - Troubleshooting Made Easy: Deciphering Alfresco mTLS Confi...
Alfresco TTL#157 - Troubleshooting Made Easy: Deciphering Alfresco mTLS Confi...Alfresco TTL#157 - Troubleshooting Made Easy: Deciphering Alfresco mTLS Confi...
Alfresco TTL#157 - Troubleshooting Made Easy: Deciphering Alfresco mTLS Confi...Angel Borroy López
 
Post Quantum Cryptography – The Impact on Identity
Post Quantum Cryptography – The Impact on IdentityPost Quantum Cryptography – The Impact on Identity
Post Quantum Cryptography – The Impact on Identityteam-WIBU
 
Large Language Models for Test Case Evolution and Repair
Large Language Models for Test Case Evolution and RepairLarge Language Models for Test Case Evolution and Repair
Large Language Models for Test Case Evolution and RepairLionel Briand
 
Folding Cheat Sheet #4 - fourth in a series
Folding Cheat Sheet #4 - fourth in a seriesFolding Cheat Sheet #4 - fourth in a series
Folding Cheat Sheet #4 - fourth in a seriesPhilip Schwarz
 
UI5ers live - Custom Controls wrapping 3rd-party libs.pptx
UI5ers live - Custom Controls wrapping 3rd-party libs.pptxUI5ers live - Custom Controls wrapping 3rd-party libs.pptx
UI5ers live - Custom Controls wrapping 3rd-party libs.pptxAndreas Kunz
 
Tech Tuesday - Mastering Time Management Unlock the Power of OnePlan's Timesh...
Tech Tuesday - Mastering Time Management Unlock the Power of OnePlan's Timesh...Tech Tuesday - Mastering Time Management Unlock the Power of OnePlan's Timesh...
Tech Tuesday - Mastering Time Management Unlock the Power of OnePlan's Timesh...OnePlan Solutions
 
Software Project Health Check: Best Practices and Techniques for Your Product...
Software Project Health Check: Best Practices and Techniques for Your Product...Software Project Health Check: Best Practices and Techniques for Your Product...
Software Project Health Check: Best Practices and Techniques for Your Product...Velvetech LLC
 
Unveiling Design Patterns: A Visual Guide with UML Diagrams
Unveiling Design Patterns: A Visual Guide with UML DiagramsUnveiling Design Patterns: A Visual Guide with UML Diagrams
Unveiling Design Patterns: A Visual Guide with UML DiagramsAhmed Mohamed
 
Global Identity Enrolment and Verification Pro Solution - Cizo Technology Ser...
Global Identity Enrolment and Verification Pro Solution - Cizo Technology Ser...Global Identity Enrolment and Verification Pro Solution - Cizo Technology Ser...
Global Identity Enrolment and Verification Pro Solution - Cizo Technology Ser...Cizo Technology Services
 
VK Business Profile - provides IT solutions and Web Development
VK Business Profile - provides IT solutions and Web DevelopmentVK Business Profile - provides IT solutions and Web Development
VK Business Profile - provides IT solutions and Web Developmentvyaparkranti
 
Balasore Best It Company|| Top 10 IT Company || Balasore Software company Odisha
Balasore Best It Company|| Top 10 IT Company || Balasore Software company OdishaBalasore Best It Company|| Top 10 IT Company || Balasore Software company Odisha
Balasore Best It Company|| Top 10 IT Company || Balasore Software company Odishasmiwainfosol
 
Maximizing Efficiency and Profitability with OnePlan’s Professional Service A...
Maximizing Efficiency and Profitability with OnePlan’s Professional Service A...Maximizing Efficiency and Profitability with OnePlan’s Professional Service A...
Maximizing Efficiency and Profitability with OnePlan’s Professional Service A...OnePlan Solutions
 
Open Source Summit NA 2024: Open Source Cloud Costs - OpenCost's Impact on En...
Open Source Summit NA 2024: Open Source Cloud Costs - OpenCost's Impact on En...Open Source Summit NA 2024: Open Source Cloud Costs - OpenCost's Impact on En...
Open Source Summit NA 2024: Open Source Cloud Costs - OpenCost's Impact on En...Matt Ray
 
Odoo 14 - eLearning Module In Odoo 14 Enterprise
Odoo 14 - eLearning Module In Odoo 14 EnterpriseOdoo 14 - eLearning Module In Odoo 14 Enterprise
Odoo 14 - eLearning Module In Odoo 14 Enterprisepreethippts
 
Catch the Wave: SAP Event-Driven and Data Streaming for the Intelligence Ente...
Catch the Wave: SAP Event-Driven and Data Streaming for the Intelligence Ente...Catch the Wave: SAP Event-Driven and Data Streaming for the Intelligence Ente...
Catch the Wave: SAP Event-Driven and Data Streaming for the Intelligence Ente...confluent
 
Xen Safety Embedded OSS Summit April 2024 v4.pdf
Xen Safety Embedded OSS Summit April 2024 v4.pdfXen Safety Embedded OSS Summit April 2024 v4.pdf
Xen Safety Embedded OSS Summit April 2024 v4.pdfStefano Stabellini
 
Sending Calendar Invites on SES and Calendarsnack.pdf
Sending Calendar Invites on SES and Calendarsnack.pdfSending Calendar Invites on SES and Calendarsnack.pdf
Sending Calendar Invites on SES and Calendarsnack.pdf31events.com
 
Understanding Flamingo - DeepMind's VLM Architecture
Understanding Flamingo - DeepMind's VLM ArchitectureUnderstanding Flamingo - DeepMind's VLM Architecture
Understanding Flamingo - DeepMind's VLM Architecturerahul_net
 
英国UN学位证,北安普顿大学毕业证书1:1制作
英国UN学位证,北安普顿大学毕业证书1:1制作英国UN学位证,北安普顿大学毕业证书1:1制作
英国UN学位证,北安普顿大学毕业证书1:1制作qr0udbr0
 

Dernier (20)

How to submit a standout Adobe Champion Application
How to submit a standout Adobe Champion ApplicationHow to submit a standout Adobe Champion Application
How to submit a standout Adobe Champion Application
 
Alfresco TTL#157 - Troubleshooting Made Easy: Deciphering Alfresco mTLS Confi...
Alfresco TTL#157 - Troubleshooting Made Easy: Deciphering Alfresco mTLS Confi...Alfresco TTL#157 - Troubleshooting Made Easy: Deciphering Alfresco mTLS Confi...
Alfresco TTL#157 - Troubleshooting Made Easy: Deciphering Alfresco mTLS Confi...
 
Post Quantum Cryptography – The Impact on Identity
Post Quantum Cryptography – The Impact on IdentityPost Quantum Cryptography – The Impact on Identity
Post Quantum Cryptography – The Impact on Identity
 
Large Language Models for Test Case Evolution and Repair
Large Language Models for Test Case Evolution and RepairLarge Language Models for Test Case Evolution and Repair
Large Language Models for Test Case Evolution and Repair
 
Folding Cheat Sheet #4 - fourth in a series
Folding Cheat Sheet #4 - fourth in a seriesFolding Cheat Sheet #4 - fourth in a series
Folding Cheat Sheet #4 - fourth in a series
 
UI5ers live - Custom Controls wrapping 3rd-party libs.pptx
UI5ers live - Custom Controls wrapping 3rd-party libs.pptxUI5ers live - Custom Controls wrapping 3rd-party libs.pptx
UI5ers live - Custom Controls wrapping 3rd-party libs.pptx
 
Tech Tuesday - Mastering Time Management Unlock the Power of OnePlan's Timesh...
Tech Tuesday - Mastering Time Management Unlock the Power of OnePlan's Timesh...Tech Tuesday - Mastering Time Management Unlock the Power of OnePlan's Timesh...
Tech Tuesday - Mastering Time Management Unlock the Power of OnePlan's Timesh...
 
Software Project Health Check: Best Practices and Techniques for Your Product...
Software Project Health Check: Best Practices and Techniques for Your Product...Software Project Health Check: Best Practices and Techniques for Your Product...
Software Project Health Check: Best Practices and Techniques for Your Product...
 
Unveiling Design Patterns: A Visual Guide with UML Diagrams
Unveiling Design Patterns: A Visual Guide with UML DiagramsUnveiling Design Patterns: A Visual Guide with UML Diagrams
Unveiling Design Patterns: A Visual Guide with UML Diagrams
 
Global Identity Enrolment and Verification Pro Solution - Cizo Technology Ser...
Global Identity Enrolment and Verification Pro Solution - Cizo Technology Ser...Global Identity Enrolment and Verification Pro Solution - Cizo Technology Ser...
Global Identity Enrolment and Verification Pro Solution - Cizo Technology Ser...
 
VK Business Profile - provides IT solutions and Web Development
VK Business Profile - provides IT solutions and Web DevelopmentVK Business Profile - provides IT solutions and Web Development
VK Business Profile - provides IT solutions and Web Development
 
Balasore Best It Company|| Top 10 IT Company || Balasore Software company Odisha
Balasore Best It Company|| Top 10 IT Company || Balasore Software company OdishaBalasore Best It Company|| Top 10 IT Company || Balasore Software company Odisha
Balasore Best It Company|| Top 10 IT Company || Balasore Software company Odisha
 
Maximizing Efficiency and Profitability with OnePlan’s Professional Service A...
Maximizing Efficiency and Profitability with OnePlan’s Professional Service A...Maximizing Efficiency and Profitability with OnePlan’s Professional Service A...
Maximizing Efficiency and Profitability with OnePlan’s Professional Service A...
 
Open Source Summit NA 2024: Open Source Cloud Costs - OpenCost's Impact on En...
Open Source Summit NA 2024: Open Source Cloud Costs - OpenCost's Impact on En...Open Source Summit NA 2024: Open Source Cloud Costs - OpenCost's Impact on En...
Open Source Summit NA 2024: Open Source Cloud Costs - OpenCost's Impact on En...
 
Odoo 14 - eLearning Module In Odoo 14 Enterprise
Odoo 14 - eLearning Module In Odoo 14 EnterpriseOdoo 14 - eLearning Module In Odoo 14 Enterprise
Odoo 14 - eLearning Module In Odoo 14 Enterprise
 
Catch the Wave: SAP Event-Driven and Data Streaming for the Intelligence Ente...
Catch the Wave: SAP Event-Driven and Data Streaming for the Intelligence Ente...Catch the Wave: SAP Event-Driven and Data Streaming for the Intelligence Ente...
Catch the Wave: SAP Event-Driven and Data Streaming for the Intelligence Ente...
 
Xen Safety Embedded OSS Summit April 2024 v4.pdf
Xen Safety Embedded OSS Summit April 2024 v4.pdfXen Safety Embedded OSS Summit April 2024 v4.pdf
Xen Safety Embedded OSS Summit April 2024 v4.pdf
 
Sending Calendar Invites on SES and Calendarsnack.pdf
Sending Calendar Invites on SES and Calendarsnack.pdfSending Calendar Invites on SES and Calendarsnack.pdf
Sending Calendar Invites on SES and Calendarsnack.pdf
 
Understanding Flamingo - DeepMind's VLM Architecture
Understanding Flamingo - DeepMind's VLM ArchitectureUnderstanding Flamingo - DeepMind's VLM Architecture
Understanding Flamingo - DeepMind's VLM Architecture
 
英国UN学位证,北安普顿大学毕业证书1:1制作
英国UN学位证,北安普顿大学毕业证书1:1制作英国UN学位证,北安普顿大学毕业证书1:1制作
英国UN学位证,北安普顿大学毕业证书1:1制作
 

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