Upload
hugs
View
120
Download
0
Embed Size (px)
DESCRIPTION
An overview of Selenium, including Selenium IDE, Selenium RC, Selenium Grid, and Sauce OnDemand (A cloud-hosted Selenium test infrastructure service). Also covers an overview of upcoming features in Selenium 2, and how to best use Selenium: use of the Page Object patter, and how to use with continuous integration.
Citation preview
Agenda• Overview of Selenium
• Selenium IDE, RC, Grid
• Sauce Labs and Sauce OnDemand
• Demo
• Selenium IDE, Sauce OnDemand
• Tips and Tricks
• Selenium 2
• Q&A
The Problem
Automated
Source: - F.O.X.: http://www.flickr.com/photos/kv/499219/
Ajax
Workflows
What is Selenium?
Selenium IDE for Firefox
“Selenese”
10
!"#$%"&'$(%)$*
+%%,-..///01*234)03$#.,+$%$5.23"6$(".789:;8<=:
Example Selenium RC Test - Java
Example Selenium RC Test - C#
Python, Ruby, Java, C#, or Perl
Test ScriptHTTP
Your AwesomeWeb App
Selenium RC Server
HTTP HTTP
Selenium Remote Control
Time
Servers
Unit of Work
Time
Servers
Unit of Work
!"#$
%&&'())***+,-#./"+.01)'%0&02)$345)67879:;)
Selenium Grid
http://www.flickr.com/photos/pagedooley/2511369048/sizes/l/
Sauce Labs
What Sauce Labs Does
• Cloud-hosted Selenium for:• Speed—run tests in parallel• Pain-free infrastructure (test infrastructure is notoriously fussy, fiddly
due to accelerating Browser numbers and version pace, security patches etc.)
• Higher availability, repeatability• Value-added (enhanced, certified) distros:
• Sauce RC (Selenium RC (remote control))• Sauce IDE (Selenium IDE)
• Commercial Support for Selenium
!"#$
%&&'())***+,-#./"+.01)'%0&02)$345)67879:;)
Sauce OnDemand (just like Grid)
Demo!
How to Avoid Selenium Poisoning
Intent Action
Action
• open 'www.example.com'
• clickAndWait 'link=Log in'
• type 'User Id', '[email protected]'
• type 'password', '12345678'
• clickAndWait 'Log In'
Intent
• Log in
• Change password
• Modify profile
• Log out
1. Write intent.2. Map to actions.
Seek higher level abstractions
Hudson
Ant/NAnt
xUnit
Selenium
Hudson
Ant/NAnt
xUnit
Business Specific Library
Selenium
Page Object Model
Google: “Selenium Page Objects”
Start small
It’ll get big anyway
What to start with?
• Smoke tests
• “Money path”
• New features
Benefits of Short Tests
• Easier to read
• Easier to write
• Easier to debug/maintain
• Easier to parallelize
Selenium 2?
• Native Keyboard & Mouse Events• Same Origin Policy / XSS / HTTP(S)• Pop-ups, dialogs
– Basic Authentication– Self-signed certificates– File upload/download
Better Control
• WebDriver Object
• WebElement Objects
Cleaner API
Python, Ruby, Java, C#, or Perl
Test ScriptHTTP
Your AwesomeWeb App
Selenium RC Server
HTTP HTTP
Selenium Remote Control
Python, Ruby, Java, C#, or Perl
Test ScriptHTTP
Your AwesomeWeb App
Selenium RC Server
HTTP HTTP
Selenium 2
Python, Ruby, Java, C#, or Perl
Test Script
Your AwesomeWeb App
HTTP HTTP
Python, Ruby, Java, C#, or Perl
Test Script
Your AwesomeWeb App
C/C++ HTTP
But... Java... Is... Still... In... There...
Python, Ruby, Java, C#, or Perl
Test ScriptHTTP
Your AwesomeWeb App
Selenium Grid
HTTP HTTP
But... Java... Is... Still... In... There...
Python, Ruby, Java, C#, or Perl
Test ScriptHTTP
Selenium Remote Server
HTTP HTTPYe Ol' Internet(Sauce Labs)
... but now only when you need it.
Q&A