SlideShare a Scribd company logo
1 of 8
Download to read offline
A Bluffer's Guide
to Selenium 2
By: Simon Stewart & Anthony Long
www.seleniumcoe.com
What Is Selenium / Sel 2 / Webdriver
Selenium is a test automation framework that interacts with a
browser via javascript.
Webdriver is a test automation framework that interacts with
the browser directly.
Selenium 2 is the merging of the Open Source "selenium" and
"webdriver" projects.
The most recent release is Selenium 2.0a4.
It's really rather good.
www.seleniumcoe.com
Alphas!?
Alphas - finish "baking" the new APIs
• Mostly done
o Need to add the advanced user API
o and handling alerts and prompts
• What's there is stable: we're only adding methods now
• Timeline: ~2 months
Betas - Implement all APIs in all supported browsers
• Supported browsers?
o Firefox 3-latest, IE 6-latest, Chrome, Android, iPhone
• Timeline: Unknown
Release - As beta, but equal support for Python, Ruby, Java
and C#
www.seleniumcoe.com
How Does It Differ From Selenium 1
Two major differences:
• Not trapped in the JS sandbox
o So there's a way to handle "alerts" on window load
cleanly.
o Better emulation of user input, such as clicking and
typing.
• Cleaner API
o So it's easier to write and maintain code.
o Far less confusion about which method to call.
www.seleniumcoe.com
Why Change?
• The OSS team are now focusing almost all their effort on
Selenium 2
• Better support for IE
o Still a huge part of the market
• Support for testing mobile browsers
o Will form a large part of the market in future
• Buy-in and support from browser manufacturers:
o Opera
o Chrome
• Becoming used by a broader range of OSS projects
o Not only Selenium, but also Watir
o More eyes and users means bugs detected more quickly
o And fixed more rapidly!
www.seleniumcoe.com
How Do I Migrate?
• Download Selenium 2
• Drop JARs into CLASSPATH
o Using Selenium 1 tech, but with the new classes
available.
• Replace "DefaultSelenium" with
"WebDriverBackedSelenium"
o An implementation of selenium using the new technology
o Inefficient, but allows a managed migration.
• Migrate code to the new API on an "as needed" basis
o Suggestion: when you edit a file using the old API, move
to the new one
www.seleniumcoe.com
What's Coming Up?
• Advanced User Interaction API:
o Allows you to model "click here, then hold shift, click on
these three elements, release shift, and drag everything
over here"
o Will be necessary for complex applications
o Selenium 2.0a5 or 6
• Implicit Waits:
o The framework will wait for an element to be present
before continuing
o Timeout easy to control
o Preview in Selenium 2.0a4, fully implemented in 2.0a5
• Android support:
o Selenium 2.0a5
www.seleniumcoe.com
If You're Working on the Selenium
Code Itself
• Shared JS
o JS is great for querying the DOM
o Shared JS functions between all webdrivers and
Selenium 1.x
o Dramatically easier to fix issues to do with JS in all
browsers
• Simplified Build Grammar
o Hey, it matters to us :)
• To build:
o svn checkout http://selenium.googlecode.com/svn/trunk/
selenium-read-only
o rake build
o cd build/
www.seleniumcoe.com

More Related Content

More from onlinemindq

A Buffer's Guide to Selenium 2
A Buffer's Guide to Selenium 2A Buffer's Guide to Selenium 2
A Buffer's Guide to Selenium 2onlinemindq
 
Selenium Open Source Tool
Selenium Open Source ToolSelenium Open Source Tool
Selenium Open Source Toolonlinemindq
 

More from onlinemindq (6)

Selenium (1)
Selenium (1)Selenium (1)
Selenium (1)
 
Selenium (2)
Selenium (2)Selenium (2)
Selenium (2)
 
Selenium.ppt
Selenium.pptSelenium.ppt
Selenium.ppt
 
Selenium 2
Selenium 2Selenium 2
Selenium 2
 
A Buffer's Guide to Selenium 2
A Buffer's Guide to Selenium 2A Buffer's Guide to Selenium 2
A Buffer's Guide to Selenium 2
 
Selenium Open Source Tool
Selenium Open Source ToolSelenium Open Source Tool
Selenium Open Source Tool
 

Recently uploaded

Quality Assurance_GOOD LABORATORY PRACTICE
Quality Assurance_GOOD LABORATORY PRACTICEQuality Assurance_GOOD LABORATORY PRACTICE
Quality Assurance_GOOD LABORATORY PRACTICESayali Powar
 
How to Make a Field read-only in Odoo 17
How to Make a Field read-only in Odoo 17How to Make a Field read-only in Odoo 17
How to Make a Field read-only in Odoo 17Celine George
 
How to Add a New Field in Existing Kanban View in Odoo 17
How to Add a New Field in Existing Kanban View in Odoo 17How to Add a New Field in Existing Kanban View in Odoo 17
How to Add a New Field in Existing Kanban View in Odoo 17Celine George
 
DUST OF SNOW_BY ROBERT FROST_EDITED BY_ TANMOY MISHRA
DUST OF SNOW_BY ROBERT FROST_EDITED BY_ TANMOY MISHRADUST OF SNOW_BY ROBERT FROST_EDITED BY_ TANMOY MISHRA
DUST OF SNOW_BY ROBERT FROST_EDITED BY_ TANMOY MISHRATanmoy Mishra
 
Easter in the USA presentation by Chloe.
Easter in the USA presentation by Chloe.Easter in the USA presentation by Chloe.
Easter in the USA presentation by Chloe.EnglishCEIPdeSigeiro
 
M-2- General Reactions of amino acids.pptx
M-2- General Reactions of amino acids.pptxM-2- General Reactions of amino acids.pptx
M-2- General Reactions of amino acids.pptxDr. Santhosh Kumar. N
 
Human-AI Co-Creation of Worked Examples for Programming Classes
Human-AI Co-Creation of Worked Examples for Programming ClassesHuman-AI Co-Creation of Worked Examples for Programming Classes
Human-AI Co-Creation of Worked Examples for Programming ClassesMohammad Hassany
 
Diploma in Nursing Admission Test Question Solution 2023.pdf
Diploma in Nursing Admission Test Question Solution 2023.pdfDiploma in Nursing Admission Test Question Solution 2023.pdf
Diploma in Nursing Admission Test Question Solution 2023.pdfMohonDas
 
CHUYÊN ĐỀ DẠY THÊM TIẾNG ANH LỚP 11 - GLOBAL SUCCESS - NĂM HỌC 2023-2024 - HK...
CHUYÊN ĐỀ DẠY THÊM TIẾNG ANH LỚP 11 - GLOBAL SUCCESS - NĂM HỌC 2023-2024 - HK...CHUYÊN ĐỀ DẠY THÊM TIẾNG ANH LỚP 11 - GLOBAL SUCCESS - NĂM HỌC 2023-2024 - HK...
CHUYÊN ĐỀ DẠY THÊM TIẾNG ANH LỚP 11 - GLOBAL SUCCESS - NĂM HỌC 2023-2024 - HK...Nguyen Thanh Tu Collection
 
Maximizing Impact_ Nonprofit Website Planning, Budgeting, and Design.pdf
Maximizing Impact_ Nonprofit Website Planning, Budgeting, and Design.pdfMaximizing Impact_ Nonprofit Website Planning, Budgeting, and Design.pdf
Maximizing Impact_ Nonprofit Website Planning, Budgeting, and Design.pdfTechSoup
 
The Stolen Bacillus by Herbert George Wells
The Stolen Bacillus by Herbert George WellsThe Stolen Bacillus by Herbert George Wells
The Stolen Bacillus by Herbert George WellsEugene Lysak
 
How to Use api.constrains ( ) in Odoo 17
How to Use api.constrains ( ) in Odoo 17How to Use api.constrains ( ) in Odoo 17
How to Use api.constrains ( ) in Odoo 17Celine George
 
How to Add a many2many Relational Field in Odoo 17
How to Add a many2many Relational Field in Odoo 17How to Add a many2many Relational Field in Odoo 17
How to Add a many2many Relational Field in Odoo 17Celine George
 
The basics of sentences session 10pptx.pptx
The basics of sentences session 10pptx.pptxThe basics of sentences session 10pptx.pptx
The basics of sentences session 10pptx.pptxheathfieldcps1
 
HED Office Sohayok Exam Question Solution 2023.pdf
HED Office Sohayok Exam Question Solution 2023.pdfHED Office Sohayok Exam Question Solution 2023.pdf
HED Office Sohayok Exam Question Solution 2023.pdfMohonDas
 
General views of Histopathology and step
General views of Histopathology and stepGeneral views of Histopathology and step
General views of Histopathology and stepobaje godwin sunday
 
Drug Information Services- DIC and Sources.
Drug Information Services- DIC and Sources.Drug Information Services- DIC and Sources.
Drug Information Services- DIC and Sources.raviapr7
 
AUDIENCE THEORY -- FANDOM -- JENKINS.pptx
AUDIENCE THEORY -- FANDOM -- JENKINS.pptxAUDIENCE THEORY -- FANDOM -- JENKINS.pptx
AUDIENCE THEORY -- FANDOM -- JENKINS.pptxiammrhaywood
 
In - Vivo and In - Vitro Correlation.pptx
In - Vivo and In - Vitro Correlation.pptxIn - Vivo and In - Vitro Correlation.pptx
In - Vivo and In - Vitro Correlation.pptxAditiChauhan701637
 

Recently uploaded (20)

Quality Assurance_GOOD LABORATORY PRACTICE
Quality Assurance_GOOD LABORATORY PRACTICEQuality Assurance_GOOD LABORATORY PRACTICE
Quality Assurance_GOOD LABORATORY PRACTICE
 
How to Make a Field read-only in Odoo 17
How to Make a Field read-only in Odoo 17How to Make a Field read-only in Odoo 17
How to Make a Field read-only in Odoo 17
 
How to Add a New Field in Existing Kanban View in Odoo 17
How to Add a New Field in Existing Kanban View in Odoo 17How to Add a New Field in Existing Kanban View in Odoo 17
How to Add a New Field in Existing Kanban View in Odoo 17
 
DUST OF SNOW_BY ROBERT FROST_EDITED BY_ TANMOY MISHRA
DUST OF SNOW_BY ROBERT FROST_EDITED BY_ TANMOY MISHRADUST OF SNOW_BY ROBERT FROST_EDITED BY_ TANMOY MISHRA
DUST OF SNOW_BY ROBERT FROST_EDITED BY_ TANMOY MISHRA
 
Easter in the USA presentation by Chloe.
Easter in the USA presentation by Chloe.Easter in the USA presentation by Chloe.
Easter in the USA presentation by Chloe.
 
M-2- General Reactions of amino acids.pptx
M-2- General Reactions of amino acids.pptxM-2- General Reactions of amino acids.pptx
M-2- General Reactions of amino acids.pptx
 
Human-AI Co-Creation of Worked Examples for Programming Classes
Human-AI Co-Creation of Worked Examples for Programming ClassesHuman-AI Co-Creation of Worked Examples for Programming Classes
Human-AI Co-Creation of Worked Examples for Programming Classes
 
Personal Resilience in Project Management 2 - TV Edit 1a.pdf
Personal Resilience in Project Management 2 - TV Edit 1a.pdfPersonal Resilience in Project Management 2 - TV Edit 1a.pdf
Personal Resilience in Project Management 2 - TV Edit 1a.pdf
 
Diploma in Nursing Admission Test Question Solution 2023.pdf
Diploma in Nursing Admission Test Question Solution 2023.pdfDiploma in Nursing Admission Test Question Solution 2023.pdf
Diploma in Nursing Admission Test Question Solution 2023.pdf
 
CHUYÊN ĐỀ DẠY THÊM TIẾNG ANH LỚP 11 - GLOBAL SUCCESS - NĂM HỌC 2023-2024 - HK...
CHUYÊN ĐỀ DẠY THÊM TIẾNG ANH LỚP 11 - GLOBAL SUCCESS - NĂM HỌC 2023-2024 - HK...CHUYÊN ĐỀ DẠY THÊM TIẾNG ANH LỚP 11 - GLOBAL SUCCESS - NĂM HỌC 2023-2024 - HK...
CHUYÊN ĐỀ DẠY THÊM TIẾNG ANH LỚP 11 - GLOBAL SUCCESS - NĂM HỌC 2023-2024 - HK...
 
Maximizing Impact_ Nonprofit Website Planning, Budgeting, and Design.pdf
Maximizing Impact_ Nonprofit Website Planning, Budgeting, and Design.pdfMaximizing Impact_ Nonprofit Website Planning, Budgeting, and Design.pdf
Maximizing Impact_ Nonprofit Website Planning, Budgeting, and Design.pdf
 
The Stolen Bacillus by Herbert George Wells
The Stolen Bacillus by Herbert George WellsThe Stolen Bacillus by Herbert George Wells
The Stolen Bacillus by Herbert George Wells
 
How to Use api.constrains ( ) in Odoo 17
How to Use api.constrains ( ) in Odoo 17How to Use api.constrains ( ) in Odoo 17
How to Use api.constrains ( ) in Odoo 17
 
How to Add a many2many Relational Field in Odoo 17
How to Add a many2many Relational Field in Odoo 17How to Add a many2many Relational Field in Odoo 17
How to Add a many2many Relational Field in Odoo 17
 
The basics of sentences session 10pptx.pptx
The basics of sentences session 10pptx.pptxThe basics of sentences session 10pptx.pptx
The basics of sentences session 10pptx.pptx
 
HED Office Sohayok Exam Question Solution 2023.pdf
HED Office Sohayok Exam Question Solution 2023.pdfHED Office Sohayok Exam Question Solution 2023.pdf
HED Office Sohayok Exam Question Solution 2023.pdf
 
General views of Histopathology and step
General views of Histopathology and stepGeneral views of Histopathology and step
General views of Histopathology and step
 
Drug Information Services- DIC and Sources.
Drug Information Services- DIC and Sources.Drug Information Services- DIC and Sources.
Drug Information Services- DIC and Sources.
 
AUDIENCE THEORY -- FANDOM -- JENKINS.pptx
AUDIENCE THEORY -- FANDOM -- JENKINS.pptxAUDIENCE THEORY -- FANDOM -- JENKINS.pptx
AUDIENCE THEORY -- FANDOM -- JENKINS.pptx
 
In - Vivo and In - Vitro Correlation.pptx
In - Vivo and In - Vitro Correlation.pptxIn - Vivo and In - Vitro Correlation.pptx
In - Vivo and In - Vitro Correlation.pptx
 

Selenium 2

  • 1. A Bluffer's Guide to Selenium 2 By: Simon Stewart & Anthony Long www.seleniumcoe.com
  • 2. What Is Selenium / Sel 2 / Webdriver Selenium is a test automation framework that interacts with a browser via javascript. Webdriver is a test automation framework that interacts with the browser directly. Selenium 2 is the merging of the Open Source "selenium" and "webdriver" projects. The most recent release is Selenium 2.0a4. It's really rather good. www.seleniumcoe.com
  • 3. Alphas!? Alphas - finish "baking" the new APIs • Mostly done o Need to add the advanced user API o and handling alerts and prompts • What's there is stable: we're only adding methods now • Timeline: ~2 months Betas - Implement all APIs in all supported browsers • Supported browsers? o Firefox 3-latest, IE 6-latest, Chrome, Android, iPhone • Timeline: Unknown Release - As beta, but equal support for Python, Ruby, Java and C# www.seleniumcoe.com
  • 4. How Does It Differ From Selenium 1 Two major differences: • Not trapped in the JS sandbox o So there's a way to handle "alerts" on window load cleanly. o Better emulation of user input, such as clicking and typing. • Cleaner API o So it's easier to write and maintain code. o Far less confusion about which method to call. www.seleniumcoe.com
  • 5. Why Change? • The OSS team are now focusing almost all their effort on Selenium 2 • Better support for IE o Still a huge part of the market • Support for testing mobile browsers o Will form a large part of the market in future • Buy-in and support from browser manufacturers: o Opera o Chrome • Becoming used by a broader range of OSS projects o Not only Selenium, but also Watir o More eyes and users means bugs detected more quickly o And fixed more rapidly! www.seleniumcoe.com
  • 6. How Do I Migrate? • Download Selenium 2 • Drop JARs into CLASSPATH o Using Selenium 1 tech, but with the new classes available. • Replace "DefaultSelenium" with "WebDriverBackedSelenium" o An implementation of selenium using the new technology o Inefficient, but allows a managed migration. • Migrate code to the new API on an "as needed" basis o Suggestion: when you edit a file using the old API, move to the new one www.seleniumcoe.com
  • 7. What's Coming Up? • Advanced User Interaction API: o Allows you to model "click here, then hold shift, click on these three elements, release shift, and drag everything over here" o Will be necessary for complex applications o Selenium 2.0a5 or 6 • Implicit Waits: o The framework will wait for an element to be present before continuing o Timeout easy to control o Preview in Selenium 2.0a4, fully implemented in 2.0a5 • Android support: o Selenium 2.0a5 www.seleniumcoe.com
  • 8. If You're Working on the Selenium Code Itself • Shared JS o JS is great for querying the DOM o Shared JS functions between all webdrivers and Selenium 1.x o Dramatically easier to fix issues to do with JS in all browsers • Simplified Build Grammar o Hey, it matters to us :) • To build: o svn checkout http://selenium.googlecode.com/svn/trunk/ selenium-read-only o rake build o cd build/ www.seleniumcoe.com