Selenium + WebDriver

OR

Automating Web Browsers for Fun and Profit

TriJS

Ryan Hayes

@RyannosaurusRex

6/14/2016

What is Browser Automation?

Doing stuff in the browser you would normally do with a mouse and keyboard...just without the mouse and keyboard.

Test Automation Spectrum

  • Back-end Unit tests (NUnit/XUnit/JUnit)
  • JavaScript Unit Tests (QUnit/Mocha)
  • Integration Tests (Nunit/XUnit/JUnit)
  • UI Testing (Jake, from QA and YOU!)

MANUAL TESTING WOOOOOO!

Automate with Selenium!

  • Write once, run everywhere (all browsers)
  • Uses WebDriver (more on this in a sec..)
  • Write browser tests in:
    • C#!
    • Java!
    • Ruby!
    • Python!
    • JavaScript or TypeScript (http://webdriver.io/)!
  • Run automated tests...
    • ...locally!
    • ...on your build/continuous integration server!
    • ...in the cloud!
    • on REAL BROWSERS!!!

Selenium + WebDriver!

Selenium Uses their WebDriver against WebDriver, which is based on WebDriver!

WebDriver could mean...:

  • Selenium's WebDriver Framework
  • W3C's WebDriver Spec
  • Each Browser Vendor's implementation of the W3C WebDriver spec

 

 

 

State of Selenium

Selenium was just JavaScript injection.  Now it's standard, for realzies APIs.

(We are here)

Selenium Tips

  • Do
    • Use the Selenium Recorder as a starting point
    • Use Page Object Pattern + Fluent API
    • Build a re-usable library of your own of composable actions.
    • Use BrowserStack to test over Safari and older IE
  • Don't
    • Automate things that change often
    • Think this will replace all manual testing
    • Use as your only type of test

Automate the Repetative and Leave Exploratory Testing to the Humans!

Automating the Web with Selenium and WebDriver

By Ryan Hayes

Automating the Web with Selenium and WebDriver

  • 4,844