Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Automation, Selenium and Sauce

Automation, Selenium and Sauce

Why jumping on the automated test bandwagon is more than just a good idea.

Santiago Suarez Ordoñez

October 05, 2012
Tweet

More Decks by Santiago Suarez Ordoñez

Other Decks in Technology

Transcript

  1. Selenium, Sauce Labs and Automated Testing Why jumping on the

    automated test bandwagon is more than just a good idea http://bit.ly/automation-slides
  2. Agenda • Automation ◦ Let's agree test automation is the

    way to go • Selenium ◦ Current state of the project ◦ Features and limitations • Sauce Labs ◦ Sauce OnDemand ◦ Sauce Scout
  3. Why test automation? • Repetitive tasks are boring • Creative

    tasks are fun • Machines are made for boring tasks • They make no mistakes • They never get tired • They are fast!
  4. Selenium Jason Huggins (@hugs) @ ThoughtWorks Open Source (Apache) Released

    in 2004 JavaScript core (tons of hackery around) Selenium Core, IDE, RC
  5. Selenium Core Deployed with the application Table-based syntax No flow

    control (conditionals, iteration) open /login type username santiago type password mySecretPassword click submit asserTitle Account Page
  6. Selenium RC Client-server architecture Multiple hacks let Selenium Core do

    XSS Tests written in various programming languages
  7. Selenium had its limitations The browsers' javascript sandbox Native popups

    and windows: ◦ alert() ◦ confirm() ◦ downloads ◦ uploads The API grew way too big (>150 methods)
  8. WebDriver Simon Stewart (@shs96c) @ ThoughtWorks Open Source (Apache 2)

    Released early 2007 A more native approach for automation A cleaner and object oriented API
  9. API differences Plain API (Selenium RC) sel.type("username", "santiago") sel.type("password", "secretPass")

    sel.click("submit") OO API (WebDriver) WebElement user = driver.findElement(By.id("username")); user.sendKeys("santiago"); WebElement pass = driver.findElement(By.id("password")); pass.sendKeys("secretPass"); pass.submit()
  10. Selenium 2 WebDriver's API Selenium's Community and user base Native

    hooks for some interactions Javascript Atoms for maintainability and instant browser support
  11. Selenium 2's support matrix Bindings: Java, Ruby, Python, C#, JavaScript,

    PHP (unofficial), Perl (unofficial) Drivers: HTMLUnit, Firefox, Chrome, Opera, IE, Safari (on the works), iOS, Android, headless webkit...
  12. Learn more! • http://seleniumhq.org/docs/ • selenium-users mailing list • http://code.google.com/p/selenium/

    Contribute! • selenium-developers mailing list • #selenium on freenode (IRC) • http://code.google.com/p/selenium/
  13. Sauce Automated Selenium's Remote Architecture taken to the Cloud Run

    your scripts locally, use our browsers remotely the internetz
  14. Features Elastic growth (pay by the minute) High parallelization limits

    Up-to-date, maintenance-free test lab Enhanced reporting (videos, screenshots, logs) Focus on your tests, not your infrastructure
  15. Free usage for open source projects Free basic accounts for

    everyone We're also cool with startups/FLOSS
  16. Sauce Connect Use Scout and OnDemand against a private server

    (localhost, 192.168.1.100, web_qa.local) http://saucelabs.com/docs/sauce-connect
  17. Q&A