Successfully reported this slideshow.
We use your LinkedIn profile and activity data to personalize ads and to show you more relevant ads. You can change your ad preferences anytime.
Selenium
what it is and what you can do with it
Selenium
● Web testing framework
● A faster way to see if your site works
● Real browsers for fidelity

Test

Server

Brow...
Applications
● Cross-browser testing
● Continuous integration
● (Scraping & automation)
Ecosystem
●
●
●
●

Two versions
Many language bindings
Two development environments
Many playback backends
Selenium IDE

Selenium 1 Test

Selenium Builder

Selenium 1 Code

Selenium 2 Code

Builder JSON

Selenium 1 APIs

Webdrive...
Selenium 1 vs 2
● v 1 is a list of testing steps
● v 2 is an API for remote-controlling browsers
Selenium 1 Tests
● Sequence of test steps
● “Go to this page, click on this link, does this
text appear?”
● Stored as “Sel...
Selenium 2 / Webdriver APIs
● Write code to control the browser
● Python, Java, Ruby, Perl, PHP, C#, node,
Groovy, etc.
Locators are for finding stuff
● Locators refer to page elements
● Multiple strategies: id, class, text, xpath…
● Ideally ...
Playback fidelity is hard!
● Javascript is everywhere: you can’t test a
page just by looking at the HTML
● Want to run tes...
No silver bullet blah blah blah
●
●
●
●

Selenium uses real browsers for fidelity
Implicit waits sometimes work
Write clea...
Getting started with Selenium 2
● Get language bindings
● Write your first test
● Run your first test
demo
Builder+GitHub+Travis+Sauce = CI
●
●
●
●

Record tests with Selenium Builder
Store them on GitHub in the project repo
Use ...
demo
http://sauceio.com/index.php/2013/03/building-a-ci-system-using-selenium-builder-github-travis-and-sauce-labs/
Substitutions
● Builder: IDE or hand-coded scripts
● Travis: another CI system, e.g Jenkins
● Sauce OnDemand: your own inf...
That’s it!
● Questions?
● Follow me on @zarkonnen_com
Selenium - what it is and what you can do with it
Selenium - what it is and what you can do with it
Upcoming SlideShare
Loading in …5
×

Selenium - what it is and what you can do with it

594 views

Published on

An introduction to Selenium, a technology for testing web sites. I give an overview of its ecosystem and also show you how to create a simple CI system based on Selenium Builder, GitHub, Travis and Sauce Labs.

Published in: Technology
  • Login to see the comments

Selenium - what it is and what you can do with it

  1. 1. Selenium what it is and what you can do with it
  2. 2. Selenium ● Web testing framework ● A faster way to see if your site works ● Real browsers for fidelity Test Server Browser
  3. 3. Applications ● Cross-browser testing ● Continuous integration ● (Scraping & automation)
  4. 4. Ecosystem ● ● ● ● Two versions Many language bindings Two development environments Many playback backends
  5. 5. Selenium IDE Selenium 1 Test Selenium Builder Selenium 1 Code Selenium 2 Code Builder JSON Selenium 1 APIs Webdriver APIs Se Interpreter HTML Ghost Selenium Server IE Firefox Chrome Opera Android etc.
  6. 6. Selenium 1 vs 2 ● v 1 is a list of testing steps ● v 2 is an API for remote-controlling browsers
  7. 7. Selenium 1 Tests ● Sequence of test steps ● “Go to this page, click on this link, does this text appear?” ● Stored as “Selenese” table or code
  8. 8. Selenium 2 / Webdriver APIs ● Write code to control the browser ● Python, Java, Ruby, Perl, PHP, C#, node, Groovy, etc.
  9. 9. Locators are for finding stuff ● Locators refer to page elements ● Multiple strategies: id, class, text, xpath… ● Ideally robust to minor page changes
  10. 10. Playback fidelity is hard! ● Javascript is everywhere: you can’t test a page just by looking at the HTML ● Want to run tests quickly but waits needed ● Reliable locators can be hard ● CSS rollovers, element visibility, etc.
  11. 11. No silver bullet blah blah blah ● ● ● ● Selenium uses real browsers for fidelity Implicit waits sometimes work Write clean, testable pages 80/20 automated/manual is still nice
  12. 12. Getting started with Selenium 2 ● Get language bindings ● Write your first test ● Run your first test
  13. 13. demo
  14. 14. Builder+GitHub+Travis+Sauce = CI ● ● ● ● Record tests with Selenium Builder Store them on GitHub in the project repo Use Travis to drive test runs on commit Use Sauce Labs’ Selenium servers
  15. 15. demo http://sauceio.com/index.php/2013/03/building-a-ci-system-using-selenium-builder-github-travis-and-sauce-labs/
  16. 16. Substitutions ● Builder: IDE or hand-coded scripts ● Travis: another CI system, e.g Jenkins ● Sauce OnDemand: your own infrastructure or another provider like TestingBot
  17. 17. That’s it! ● Questions? ● Follow me on @zarkonnen_com

×