• Share
  • Email
  • Embed
  • Like
  • Private Content
APIs: A Better Alternative to Page Objects
 

APIs: A Better Alternative to Page Objects

on

  • 1,691 views

Eileen Xie, Head of #sfse lightning takls

Eileen Xie, Head of #sfse lightning takls

Statistics

Views

Total Views
1,691
Views on SlideShare
1,691
Embed Views
0

Actions

Likes
1
Downloads
17
Comments
0

0 Embeds 0

No embeds

Accessibility

Categories

Upload Details

Uploaded via as Adobe PDF

Usage Rights

© All Rights Reserved

Report content

Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
  • Full Name Full Name Comment goes here.
    Are you sure you want to
    Your message goes here
    Processing…
Post Comment
Edit your comment

    APIs: A Better Alternative to Page Objects APIs: A Better Alternative to Page Objects Presentation Transcript

    • 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