SlideShare a Scribd company logo
APIs: A Better Alternative
    to Page Objects
             Eileen Xie
     Head of Quality at PBworks
           #sfse 8/23/11
Page Objects
What are they trying to
        solve?
What are they trying to
        solve?

• repetition
• maintenance
• readability
How well do they solve
       them?
How well do they solve
       them?

• repetition: poorly
• maintenance: poorly
• readability: poorly
Repetition
Repetition

• still too many steps
• some steps repeated over and over
  homePage = HomePage.load();
  loginPage = homePage.getLoginLink().click();
  welcomePage = loginPage.login();
  newTaskPage = welcomePage.getNewTaskLink().click();
  newTaskPage.getTaskNameField().type(“Learn Selenium”);
Maintenance
Maintenance

• huge overhead
• QA needs to maintain and fix
• still dependent on page workflow
• still dependent on page structure/layout
Readability
Readability


• see repetition
What can we do
   instead?
What can we do
        instead?


• APIs!
APIs
What do they look like?
What do they look like?

 createNetwork();
 createNetworkWorkspace();
 addNetworkUser();
What do they look like
  under the hood?
What do they look like
  under the hood?

function createNetworkFolder(name) {
    curl(“http://pbworks.com/api_v2/op/
    CreateNetworkFolder/name/” + name);
}
What?

• Where’s all the code?
• Why would we do this?
• How do the API calls get tested?
• How do we start?
• Wait a minute...
Where’s all the code?
Where’s all the code?


• in the product!
• really.
Why would we do this?
Why would we do this?
• less repetition
• makes tests clearer
• maintained by developers
• easier to read
• makes software more testable
• test execution speed
• better than straight SQL insertions
How do the API calls
   get tested?
How do the API calls
    get tested?
• separate tests!
• one test does the API stuff through the UI
  dashboardPage.getNewTaskLink().click();
  newTaskPage.getTaskNameField().type(“Learn Selenium”);
  newTaskPage.getTaskDueDateField().type(“8/31/11”);


• every other test calls the API
  createTask();
How do we start?
How do we start?

• figure out what the functions are
• talk to your devs!
• start with new functionality
• greenfield projects
Wait a minute...
Wait a minute...

• requires a ton of cooperation from devs
• huge upfront cost
• doesn’t actually replace page objects
Summary

• APIs are awesome
• ...and a pain in the ass to start using
• complimentary to page objects
More Info


• Our API: http://secure.pbworks.com/api_v2/
• Me: eileen.xie@pbworks.com

More Related Content

PPT
bai giang mon sql- buoi 1.ppt
PDF
Phân tích và thiết kế hệ thống quản lý bán hàng
PPTX
Object Relation Mapping in Odoo 16
PPTX
Coding conventions
PDF
Core JavaScript
PPT
Kiem thu phan mem
PDF
Tài liệu data warehouse vietsub
PPTX
Tấn công sql injection sử dụng câu lệnh select union
bai giang mon sql- buoi 1.ppt
Phân tích và thiết kế hệ thống quản lý bán hàng
Object Relation Mapping in Odoo 16
Coding conventions
Core JavaScript
Kiem thu phan mem
Tài liệu data warehouse vietsub
Tấn công sql injection sử dụng câu lệnh select union

What's hot (20)

PPT
Coding standard
PPT
UML mô hình khái niệm
PDF
Functional Domain Modeling - The ZIO 2 Way
PDF
C# conventions & good practices
PDF
Anatomy of a Spring Boot App with Clean Architecture - Spring I/O 2023
PPTX
Slide Báo Cáo Đồ Án Tốt Nghiệp CNTT
PDF
Beyond Hexagonal architecture
PDF
Các mô hình dữ liệu
PDF
Bài 9: Sao lưu và khôi phục hệ thống Domain - Giáo trình FPT
PDF
Phân tích thiết kế hệ thống thông tin PTIT
PPT
Bài giảng ACCESS - VBA
PPT
C3 danh sachlienket
DOC
Cài đặt và cấu hình dns server trên windows server 2012
PPT
Bài giảng cơ sở dữ liệu
PDF
Mạng neural nhân tạo và ứng dụng trong xử lý ngôn ngữ tự nhiên
PDF
Cơ Sở Dữ Liệu - Chương 1
PPT
PDF
Reactive clean architecture
PPT
Bài giảng lập trình Java cơ bản - Java Programming
PPTX
Domain driven design 8장
Coding standard
UML mô hình khái niệm
Functional Domain Modeling - The ZIO 2 Way
C# conventions & good practices
Anatomy of a Spring Boot App with Clean Architecture - Spring I/O 2023
Slide Báo Cáo Đồ Án Tốt Nghiệp CNTT
Beyond Hexagonal architecture
Các mô hình dữ liệu
Bài 9: Sao lưu và khôi phục hệ thống Domain - Giáo trình FPT
Phân tích thiết kế hệ thống thông tin PTIT
Bài giảng ACCESS - VBA
C3 danh sachlienket
Cài đặt và cấu hình dns server trên windows server 2012
Bài giảng cơ sở dữ liệu
Mạng neural nhân tạo và ứng dụng trong xử lý ngôn ngữ tự nhiên
Cơ Sở Dữ Liệu - Chương 1
Reactive clean architecture
Bài giảng lập trình Java cơ bản - Java Programming
Domain driven design 8장
Ad

Viewers also liked (10)

PDF
Perils of Page-Object Pattern
PDF
Better Page Object Handling with Loadable Component Pattern
PPTX
Acceptance test styles - Imperative vs Declarative
PPT
A journey beyond the page object pattern
PPT
(Seleniumcamp) Selenium IDE как артефакт пикника на обочине
PDF
Page Objects Done Right - selenium conference 2014
ODP
Testing RESTful Webservices using the REST-assured framework
PPTX
DaKiRY_BAQ2016_QADay_Круглий стіл: "Чи помре ручне тестування з часом" Учасни...
PDF
RSpec 2 Best practices
PDF
Atomic design
Perils of Page-Object Pattern
Better Page Object Handling with Loadable Component Pattern
Acceptance test styles - Imperative vs Declarative
A journey beyond the page object pattern
(Seleniumcamp) Selenium IDE как артефакт пикника на обочине
Page Objects Done Right - selenium conference 2014
Testing RESTful Webservices using the REST-assured framework
DaKiRY_BAQ2016_QADay_Круглий стіл: "Чи помре ручне тестування з часом" Учасни...
RSpec 2 Best practices
Atomic design
Ad

Similar to APIs: A Better Alternative to Page Objects (20)

PPTX
Automated Acceptance Testing from Scratch
PDF
Easy automation.py
PPTX
Testing Rapidly Changing Applications With Self-Testing Object-Oriented Selen...
PPTX
Selenium withnet
PPTX
Beyond DevOps - How Netflix Bridges the Gap
PDF
The Many Ways to Test Your React App
PPTX
Helpful Automation Techniques - Selenium Camp 2014
PPTX
Azure Functions Real World Examples
PPTX
System insight without Interference
PDF
Node.js Development Workflow Automation with Grunt.js
PDF
Refactoring @ Mindvalley: Smells, Techniques and Patterns
PDF
Start with passing tests (tdd for bugs) v0.5 (22 sep 2016)
PDF
Developing Brilliant and Powerful APIs in Ruby & Python
PPTX
My Little Webap - DevOpsSec is Magic
PPTX
Do not automate GUI testing
KEY
Pragmatic Continuous Delivery - ReaktorDevDay 2012
PPTX
Continuous feature-development
PPTX
Introduction to cypress in Angular (Chinese)
PDF
Infinum Android Talks #13 - Developing Android Apps Like Navy Seals by Ivan Kušt
PPTX
Webservices: The RESTful Approach
Automated Acceptance Testing from Scratch
Easy automation.py
Testing Rapidly Changing Applications With Self-Testing Object-Oriented Selen...
Selenium withnet
Beyond DevOps - How Netflix Bridges the Gap
The Many Ways to Test Your React App
Helpful Automation Techniques - Selenium Camp 2014
Azure Functions Real World Examples
System insight without Interference
Node.js Development Workflow Automation with Grunt.js
Refactoring @ Mindvalley: Smells, Techniques and Patterns
Start with passing tests (tdd for bugs) v0.5 (22 sep 2016)
Developing Brilliant and Powerful APIs in Ruby & Python
My Little Webap - DevOpsSec is Magic
Do not automate GUI testing
Pragmatic Continuous Delivery - ReaktorDevDay 2012
Continuous feature-development
Introduction to cypress in Angular (Chinese)
Infinum Android Talks #13 - Developing Android Apps Like Navy Seals by Ivan Kušt
Webservices: The RESTful Approach

More from Sauce Labs (20)

PDF
Simplify Salesforce Testing with AI-Driven Codeless Tools
PDF
Testing on Mobile Devices with Location Services
PDF
Your Framework for Success: introduction to JavaScript Testing at Scale
PDF
Automating Hybrid Applications with Appium
PDF
Quality at Speed: More API Testing, Less UI Testing
PPTX
Creating Digital Confidence with Test Automation
PDF
Just Enough (Automated) Testing
PDF
Using Axe to Add Accessibility Checks to Your Existing Selenium Tests
PDF
How Open Source Helps to Bring Back Product Obsession
PDF
Webinar: A Sneak Peek at Selenium 4 with Simon Stewart
PDF
[Deu] Test Automatisierung Mit Web Driver.io
PDF
Accelerating Innovation: Leveraging Open Source to Optimize Your Shift-Left I...
PDF
Accelerating Your Digital Agenda with Continuous Testing ft. Forrester
PDF
How to Measure Success in Continuous Testing
PDF
From Zero to 2.7 Million - How Verizon Media Embraced Open Source to Accelera...
PDF
5 Steps to Jump Start Your Test Automation
PDF
Sauce Labs Webinar: Rising Importance of Software Testing
PDF
BDD With Selenide by Hima Bindu Peteti
PDF
Closer To the Metal - Why and How We Use XCTest and Espresso by Mario Negro P...
PDF
Continuous Delivery for "Mature" Codebases by Melisa Benua
Simplify Salesforce Testing with AI-Driven Codeless Tools
Testing on Mobile Devices with Location Services
Your Framework for Success: introduction to JavaScript Testing at Scale
Automating Hybrid Applications with Appium
Quality at Speed: More API Testing, Less UI Testing
Creating Digital Confidence with Test Automation
Just Enough (Automated) Testing
Using Axe to Add Accessibility Checks to Your Existing Selenium Tests
How Open Source Helps to Bring Back Product Obsession
Webinar: A Sneak Peek at Selenium 4 with Simon Stewart
[Deu] Test Automatisierung Mit Web Driver.io
Accelerating Innovation: Leveraging Open Source to Optimize Your Shift-Left I...
Accelerating Your Digital Agenda with Continuous Testing ft. Forrester
How to Measure Success in Continuous Testing
From Zero to 2.7 Million - How Verizon Media Embraced Open Source to Accelera...
5 Steps to Jump Start Your Test Automation
Sauce Labs Webinar: Rising Importance of Software Testing
BDD With Selenide by Hima Bindu Peteti
Closer To the Metal - Why and How We Use XCTest and Espresso by Mario Negro P...
Continuous Delivery for "Mature" Codebases by Melisa Benua

Recently uploaded (20)

PDF
TokAI - TikTok AI Agent : The First AI Application That Analyzes 10,000+ Vira...
PDF
Bridging biosciences and deep learning for revolutionary discoveries: a compr...
PDF
Unlocking AI with Model Context Protocol (MCP)
PDF
Dropbox Q2 2025 Financial Results & Investor Presentation
PDF
Modernizing your data center with Dell and AMD
PDF
Approach and Philosophy of On baking technology
PDF
Spectral efficient network and resource selection model in 5G networks
PPTX
Big Data Technologies - Introduction.pptx
PDF
Empathic Computing: Creating Shared Understanding
PDF
7 ChatGPT Prompts to Help You Define Your Ideal Customer Profile.pdf
PDF
Per capita expenditure prediction using model stacking based on satellite ima...
PPTX
VMware vSphere Foundation How to Sell Presentation-Ver1.4-2-14-2024.pptx
PDF
Shreyas Phanse Resume: Experienced Backend Engineer | Java • Spring Boot • Ka...
PPTX
Detection-First SIEM: Rule Types, Dashboards, and Threat-Informed Strategy
PDF
KodekX | Application Modernization Development
PDF
Reach Out and Touch Someone: Haptics and Empathic Computing
PPTX
Effective Security Operations Center (SOC) A Modern, Strategic, and Threat-In...
PPTX
PA Analog/Digital System: The Backbone of Modern Surveillance and Communication
PPTX
MYSQL Presentation for SQL database connectivity
PPT
“AI and Expert System Decision Support & Business Intelligence Systems”
TokAI - TikTok AI Agent : The First AI Application That Analyzes 10,000+ Vira...
Bridging biosciences and deep learning for revolutionary discoveries: a compr...
Unlocking AI with Model Context Protocol (MCP)
Dropbox Q2 2025 Financial Results & Investor Presentation
Modernizing your data center with Dell and AMD
Approach and Philosophy of On baking technology
Spectral efficient network and resource selection model in 5G networks
Big Data Technologies - Introduction.pptx
Empathic Computing: Creating Shared Understanding
7 ChatGPT Prompts to Help You Define Your Ideal Customer Profile.pdf
Per capita expenditure prediction using model stacking based on satellite ima...
VMware vSphere Foundation How to Sell Presentation-Ver1.4-2-14-2024.pptx
Shreyas Phanse Resume: Experienced Backend Engineer | Java • Spring Boot • Ka...
Detection-First SIEM: Rule Types, Dashboards, and Threat-Informed Strategy
KodekX | Application Modernization Development
Reach Out and Touch Someone: Haptics and Empathic Computing
Effective Security Operations Center (SOC) A Modern, Strategic, and Threat-In...
PA Analog/Digital System: The Backbone of Modern Surveillance and Communication
MYSQL Presentation for SQL database connectivity
“AI and Expert System Decision Support & Business Intelligence Systems”

APIs: A Better Alternative to Page Objects

  • 1. APIs: A Better Alternative to Page Objects Eileen Xie Head of Quality at PBworks #sfse 8/23/11
  • 3. What are they trying to solve?
  • 4. What are they trying to solve? • repetition • maintenance • readability
  • 5. How well do they solve them?
  • 6. How well do they solve them? • repetition: poorly • maintenance: poorly • readability: poorly
  • 8. Repetition • still too many steps • some steps repeated over and over homePage = HomePage.load(); loginPage = homePage.getLoginLink().click(); welcomePage = loginPage.login(); newTaskPage = welcomePage.getNewTaskLink().click(); newTaskPage.getTaskNameField().type(“Learn Selenium”);
  • 10. Maintenance • huge overhead • QA needs to maintain and fix • still dependent on page workflow • still dependent on page structure/layout
  • 13. What can we do instead?
  • 14. What can we do instead? • APIs!
  • 15. APIs
  • 16. What do they look like?
  • 17. What do they look like? createNetwork(); createNetworkWorkspace(); addNetworkUser();
  • 18. What do they look like under the hood?
  • 19. What do they look like under the hood? function createNetworkFolder(name) { curl(“http://pbworks.com/api_v2/op/ CreateNetworkFolder/name/” + name); }
  • 20. What? • Where’s all the code? • Why would we do this? • How do the API calls get tested? • How do we start? • Wait a minute...
  • 22. Where’s all the code? • in the product! • really.
  • 23. Why would we do this?
  • 24. Why would we do this? • less repetition • makes tests clearer • maintained by developers • easier to read • makes software more testable • test execution speed • better than straight SQL insertions
  • 25. How do the API calls get tested?
  • 26. How do the API calls get tested? • separate tests! • one test does the API stuff through the UI dashboardPage.getNewTaskLink().click(); newTaskPage.getTaskNameField().type(“Learn Selenium”); newTaskPage.getTaskDueDateField().type(“8/31/11”); • every other test calls the API createTask();
  • 27. How do we start?
  • 28. How do we start? • figure out what the functions are • talk to your devs! • start with new functionality • greenfield projects
  • 30. Wait a minute... • requires a ton of cooperation from devs • huge upfront cost • doesn’t actually replace page objects
  • 31. Summary • APIs are awesome • ...and a pain in the ass to start using • complimentary to page objects
  • 32. More Info • Our API: http://secure.pbworks.com/api_v2/ • Me: eileen.xie@pbworks.com