Selenium...
...how it came to be, what does it do, and how to use it
Ana Prpic,
QA Engineer @OradianHQ
Twitter: @a_prpic
Mail: aprpic@gmail.com
WE ARE HIRING!!
...talk to me later if youre interested in working with me!
What is Selenium?
Selenium is a suite of tools for
automating web browsers across
platforms
Selenium is a software
testing robot, sent from
the future to help us test
websites
-Jason Huggins
What does it do?
Mimics human action
Does so by leveraging locators
- they tell Selenium which
HTML element to interact with
some common actions:
getUrl(), click(), submit() etc.
Selenium Suite
Selenium IDE
Selenium
WebDriver
Selenium Grid
Selenium RC
How it all started
Selenium Core
2004. - Jason Huggins - ThoughtWorks
Table-based syntax
JavaScriptTestRunner
Open-sourced in 2004.
Table syntax?
Each row represents a command for browser to
execute
It is split into three columns:
The first column - name of the command to execute
The second column - element identifier
The third column - optional value
Example
command element value
open /mytestpage
type #nameField Rick Sanchez
click #submitButton
verifyText #name Rick Sanchez
Selenese commands
Actions
click()
select()
Accessors
storeTitle()
Assertions - three modes:
assert - assertTitle()
verify - verifyText()
waitFor - waitForElementPresent()
The same origin policy
The same-origin policy restricts how a
document or script loaded from one origin
can interact with a resource from another
origin. It is a critical security mechanism for
isolating potentially malicious documents.
(Same-origin policy, MDN)
Selenium Remote Control
Paul Hammant - Selenium server - every request can
be intercepted by Selenium
This opened up the possibility of writing Selenium
bindings in multiple languages
Selenium IDE
Shinya Kasatani
Firefox add-on
Record & Playback
Donated to the Selenium Project in 2006.
No longer supported
(Applitools engineers working on a complete re-write!)
Selenium WebDriver
2007. Simon Stewart - ThoughtWorks - wanted a tool
that spoke directly to the browser using native
method for the browser and the OS
Selenium RC - dictionary-based API - wide range of
languages
Selenium WebDriver - object-oriented API - Java
2009. The two projects announced merger
Supported languages include Java, C#, Python, Ruby
etc.
Supported browsers: Chrome, Firefox, IE, Opera
The original RC is deprecated, but is still running in
maintenance mode
Selenium Grid
Patrick Lightbody
Parallelisation!
Uses Hub & Node concept
SauceLabs, BrowserStack, TestingBot, Ghostlab, CrossBrowser
Testing etc.
(from ToolsQA)
Selenium today
WebDriver rules
Support for ALL major browsers
Every major programming language
Selenium Server has grid capabilities built-in
October 2015
Demo time!
November 2015
Selenium Tests
Create a WebDriver instance
Navigate to a Web page
Locate an HTML element on the
Web page
Perform an action on an HTML
element
Anticipate the browser response
to the action
Run tests and record test results
using a test framework
Conclude the test
Sauce Labs
Demo
Were going to automate THE INTERNET!
the-internet-herokuapp.com by Dave Haeffner (blog)
Form Authentication example
Next Step - dive in yourself!
Resources (blogs, videos, documentation, webinars etc.):
Beaufort Fairmont - webinars
Test Talks - podcast
WebdriverIO - official docs
JavaScript - Reference Docs
Setting Up an End-to-End Testing Workflow with Gulp, Mocha, and
WebdriverIO - blog
SeleniumConf Talks
Automate The Planet -blog
etc.
Recap
Selenium History
Selenium Today
Selenium Demo
Next steps
Thank you!
Questions?