SlideShare a Scribd company logo
Selenium Basics Workshop

Frank Cohen, +01 (408) 871-0122, fcohen@pushtotest.com

                    April 20, 2011
Open Source Test Automation




About PushToTest
‣ Our Mission: Test, To Make A More Reliable World
‣ Make It Easier To Move From Manual To Automated Testing
‣ Support Advanced Testing, including Agile, Load, Integration
‣ Open Source Testing (OST) For Everyone



2
Open Source Test Automation




Today
‣ How To Use Selenium in Rich Internet Application (RIA, using Ajax)
  Environments

‣ How To Data Enable Selenium Tests Using TestMaker
‣ Testing in Flash/Flex Environments Using AMF Protocols
‣ Integrating TestMaker Tests Into Your Continuous Integration
  Environment

‣ How To Analyze Test Results Into Actionable Knowledge

3
Open Source Test Automation




Manual Testing Process
          Results




                        4                    1



      Recommend Changes
                                              Explore
                              Manual
                              Testing

                                                         Tes
                    3                                        t
                                              2         Plan



4        Run The Test Steps
                                        Create Test Plans
Open Source Test Automation




Side Effects
‣ Exhaustion
‣ Fatigue
‣ Blurry Vision
‣ Night Sweats
‣ Insanity
‣ Hair Loss
‣ Acne
‣ Divorce
5
Open Source Test Automation




OST Architecture
                                Application Under Test                                     PTTMonitor
                                      Web, RIA, BPM, SOA                                 CPU, Net, Memory




Functional
                                                   Test Injector                                                   Test Authoring
   Test
                   Bundles                   ScriptRunners               Data Production Libraries                      SoapUI (Pro)
                MySQL, HtmlUnit         Sahi, Selenium, SoapUI, Java        csv files, rdbms queries                      Sahi (Pro)
                                                                                                                   JUnit Class Framework
Load Test                                                                                                             Eclipse Java IDE
                                                                                                                           Fitness
                                          Test Operation Console                                                  Languages: Java, Python
                                                                                                                     Wiki Collaboration

Production      Designer           Grid and Cloud           Repository          Results Analysis
              Record/Playback       Test Deployment        MySQL RDBMS        Business Intelligence Tool
 Monitor


             Continuous                                                   Test
                                  Repository          Bug Tracker                          Monitoring
             Integration                                               Management




6
Open Source Test Automation




Selenium Browser Automation
‣ Selenium Core
‣ Selenium RC
‣ Selenium Grid
‣ Selenium IDE
‣ Selenium Domain Specific Language (DSL)


7
Open Source Test Automation




Selenium Architecture
                      Selenium 1                                  Selenium 2 (WebDriver)

                                        Browser                                               Browser

                                         iFrame                                              Browser API
    Selenium Client      Selenium RC                 Selenium Client   Selenium Server
                                       Browserbot                                            Application
                                                                                             Under Test
                                       Application
                                                                                               (AUT)
                                       Under Test
                                         (AUT)                                                  DOM
                                          DOM
                                                                                              Javascript
                                       Javascript




8
Open Source Test Automation




Selenium Language Basics
‣ Page Commands
‣ Element Commands
‣ Validation Commands
‣ Assertion Commands
‣ Storage Commands


9
Open Source Test Automation




Selenium Locators
‣ Identifiers
  ‣ loginForm
  ‣ id=loginForm
  ‣ name=loginForm
‣ XPath (1.0 from W3C, no support of 2.0 and XQuery)
‣ Link Locator
  ‣ link=Continue <a href=”myurl”>Continue</a>
‣ DOM APIs
  ‣ dom=document.getElementById('loginForm')
‣ CSS Selectors
10
  ‣ css=input.required[type="text"]
Open Source Test Automation




Event Handling and Ajax
‣ Selenium Tests Are Event Oriented
  ‣ Not Timing Oriented
‣ Ajax Web Objects
  ‣ Complicated Structures
  ‣ Dynamic Values
  ‣ Asynchronous Events
  ‣ No Standards
‣ Ajax Example
11
Open Source Test Automation




We Recommend
            Do                Don’t
       Components             Pause
      Record -> Script   Use Static Values
     Dynamic Locators     Storage Values
      Work With Devs      Test and Trash
          Events         Expect The Same


12
Open Source Test Automation




Flex, Flash Testing
‣ Extend the Selenium RC clients for adding Flash communication
  ‣ http://code.google.com/p/flex-ui-selenium/
  ‣ http://code.google.com/p/flash-selenium/
       public void sumForValidNumbers() {
            flexUITester.type("2").at("arg1");
            flexUITester.type("3").at("arg2");
            flexUITester.click("submit");
            assertEquals("5", flexUITester.readFrom("result"));
       }



‣ Flex Automation API - Flexmonkium
13
Open Source Test Automation




TestMaker and Selenium
            Application Under Test




                       TestNode
         Selenium RC              SeleniumHtmlUnit

                   Selenese Test




            TestMaker Console

14
Open Source Test Automation




TestMaker Object Designer
‣ Point-and-Click Functional Test Record/Playback
‣ Record Tests In IE, Chrome, Firefox, Safari, Opera
‣ Automatic Ajax Synchronization
‣ Drag-and-Drop Data Driven Testing
‣ Creates Selenium, Sahi, and Flex Tests


15
Open Source Test Automation




Resources
‣ http://www.pushtotest.com/
‣ http://seleniumhq.org
‣ http://selenium.pushtotest.com
‣ http://refcardz.dzone.com/refcardz/getting-started-selenium
‣ http://refcardz.dzone.com/refcardz/getting-started-selenium-20
‣ http://www.pushtotest.com/products-comparison
‣ http://www.pushtotest.com/selenium-conference-2011-analysis
‣ http://www.slideshare.net/frankcohen/selenium-xpath-performance-
  problems-in-ie
16
Open Source Test Automation




Where To Go From Here
‣ Watch A Screencast and Tutorial
  ‣ http://www.pushtotest.com/screencastcentral
‣ The Selenium Tutorial for Beginners
  ‣ http://www.pushtotest.com/selenium-webinar-series
‣ Attend An Open Source Test Workshop
  ‣ http://workshop.pushtotest.com
‣ Ask For A Proposal on Licenses, Training, Support, Consulting
  ‣ Call +01 408 871 0122, sales@pushtotest.com
17

More Related Content

PPTX
Automation Testing by Selenium Web Driver
PPT
Selenium Concepts
PPT
Automation With A Tool Demo
PDF
Hướng dẫn sử dụng Selenium ide
DOCX
Selenium interview-questions-freshers
PPTX
Cypress Testing.pptx
PPTX
Data driven Automation Framework with Selenium
PPT
Automated Web Testing Using Selenium
Automation Testing by Selenium Web Driver
Selenium Concepts
Automation With A Tool Demo
Hướng dẫn sử dụng Selenium ide
Selenium interview-questions-freshers
Cypress Testing.pptx
Data driven Automation Framework with Selenium
Automated Web Testing Using Selenium

What's hot (20)

PPTX
Test automation using selenium
PDF
Automation Testing using Selenium
PPTX
Setting up Page Object Model in Automation Framework
PDF
The Journey to DevOps #MFSummit2017
PPT
Selenium
PDF
Latest Selenium Interview Questions And Answers.pdf
PDF
Web automation using selenium.ppt
PDF
Selenium interview questions and answers
PPT
Selenium Presentation at Engineering Colleges
PPTX
Selenium
PPTX
How to Design a Successful Test Automation Strategy
PDF
Selenium Maven With Eclipse | Edureka
PPTX
Automation Testing
PPT
Android & iOS Automation Using Appium
PPTX
Python selenium
PPS
Selenium Demo
PPT
Selenium ppt
PPS
Final Automation Testing
PDF
Cross-Browser-Testing with Protractor & Browserstack
PPTX
Api-First service design
Test automation using selenium
Automation Testing using Selenium
Setting up Page Object Model in Automation Framework
The Journey to DevOps #MFSummit2017
Selenium
Latest Selenium Interview Questions And Answers.pdf
Web automation using selenium.ppt
Selenium interview questions and answers
Selenium Presentation at Engineering Colleges
Selenium
How to Design a Successful Test Automation Strategy
Selenium Maven With Eclipse | Edureka
Automation Testing
Android & iOS Automation Using Appium
Python selenium
Selenium Demo
Selenium ppt
Final Automation Testing
Cross-Browser-Testing with Protractor & Browserstack
Api-First service design
Ad

Similar to Selenium Basics Tutorial (20)

PDF
Migrating from HP QuickTest Pro QTP to TestMaker Object Designer
PDF
Migrating From HP QTP To TestMaker 6
PDF
New Generation Record/Playback Tools for AJAX Testing
PDF
Agile Open Source Performance Test Workshop for Developers, Testers, IT Ops
PDF
Continuous Integration with TestMaker, Hudson, Jenkins, Bamboo
PDF
Agile Open Source Performance Testing Workshop for Business Managers
PDF
Neil Tompson - SoftTest Ireland
PDF
Open Source Test Workshop for CIOs, CTOs, Managers
KEY
Where Testing and Test Management Collide
PPTX
Test automation using selenium
PDF
Automated testing DrupalCamp in Asheville
PPTX
Codeception
PDF
San Jose Selenium Meet-up PushToTest TestMaker Presentation
PPT
Data driven automation testing of web applications using selenium
PDF
Oracle Forms Performance Testing PushToTest TestMaker JAT
PDF
Selenium XPath Performance Problems in IE
PDF
Web Test Automation Framework - IndicThreads Conference
PPTX
Growing Trends of Open Source UI Frameworks
PDF
TestMaker Object Designer Training - Basics
PPTX
SPA 2009 - Acceptance Testing AJAX Web Applications through the GUI
Migrating from HP QuickTest Pro QTP to TestMaker Object Designer
Migrating From HP QTP To TestMaker 6
New Generation Record/Playback Tools for AJAX Testing
Agile Open Source Performance Test Workshop for Developers, Testers, IT Ops
Continuous Integration with TestMaker, Hudson, Jenkins, Bamboo
Agile Open Source Performance Testing Workshop for Business Managers
Neil Tompson - SoftTest Ireland
Open Source Test Workshop for CIOs, CTOs, Managers
Where Testing and Test Management Collide
Test automation using selenium
Automated testing DrupalCamp in Asheville
Codeception
San Jose Selenium Meet-up PushToTest TestMaker Presentation
Data driven automation testing of web applications using selenium
Oracle Forms Performance Testing PushToTest TestMaker JAT
Selenium XPath Performance Problems in IE
Web Test Automation Framework - IndicThreads Conference
Growing Trends of Open Source UI Frameworks
TestMaker Object Designer Training - Basics
SPA 2009 - Acceptance Testing AJAX Web Applications through the GUI
Ad

More from Clever Moe (20)

PDF
6 solutions to ad costs going up while results are flat.
PDF
1.6 billion people are on Facebook, how will you get to the 1 that buys your ...
PDF
How do I get good at Twitter Ads?
PDF
Marketing faster than your competitors in 5 easy steps
PDF
Local customers are out there, just where
PDF
Do i need an ad agency to be good at facebook ads
PDF
I know facebook ads, how do i expand to twitter, linked in, youtube
PDF
5 solutions to the digital ad networks unsolvable puzzle
PDF
Instagram ads look super complicated, what can i do in 15 minutes?
PDF
How to get 1,000 people to look at your product for $1,000
PDF
Defending your ad budget from Facebook and LinkedIn AIs
PDF
Do i need an ad agency to be good at Facebook ads?
PDF
Marketing faster than your competitors in 5 easy steps
PDF
Making With A Disney Imagineer and Muppeteer
PDF
Continuous Integration, Deploy, Test From Beginning To End 2014
PDF
STARWest: Use Jenkins For Continuous 
Load Testing And Mobile Test Automation
PDF
Use Jenkins For Continuous Load Testing And Mobile Test Automation
PDF
Deeper Root Cause Analysis to App Performance Bottlenecks with Appvance APM I...
PDF
CloudBees Continuous Integration and Test with Appvance PerformanceCloud
PDF
Running JMeter Tests In Appvance PerformanceCloud
6 solutions to ad costs going up while results are flat.
1.6 billion people are on Facebook, how will you get to the 1 that buys your ...
How do I get good at Twitter Ads?
Marketing faster than your competitors in 5 easy steps
Local customers are out there, just where
Do i need an ad agency to be good at facebook ads
I know facebook ads, how do i expand to twitter, linked in, youtube
5 solutions to the digital ad networks unsolvable puzzle
Instagram ads look super complicated, what can i do in 15 minutes?
How to get 1,000 people to look at your product for $1,000
Defending your ad budget from Facebook and LinkedIn AIs
Do i need an ad agency to be good at Facebook ads?
Marketing faster than your competitors in 5 easy steps
Making With A Disney Imagineer and Muppeteer
Continuous Integration, Deploy, Test From Beginning To End 2014
STARWest: Use Jenkins For Continuous 
Load Testing And Mobile Test Automation
Use Jenkins For Continuous Load Testing And Mobile Test Automation
Deeper Root Cause Analysis to App Performance Bottlenecks with Appvance APM I...
CloudBees Continuous Integration and Test with Appvance PerformanceCloud
Running JMeter Tests In Appvance PerformanceCloud

Recently uploaded (20)

PDF
solutions_manual_-_materials___processing_in_manufacturing__demargo_.pdf
PDF
madgavkar20181017ppt McKinsey Presentation.pdf
PDF
GDG Cloud Iasi [PUBLIC] Florian Blaga - Unveiling the Evolution of Cybersecur...
PDF
Blue Purple Modern Animated Computer Science Presentation.pdf.pdf
PPTX
Detection-First SIEM: Rule Types, Dashboards, and Threat-Informed Strategy
PDF
Shreyas Phanse Resume: Experienced Backend Engineer | Java • Spring Boot • Ka...
PDF
cuic standard and advanced reporting.pdf
PDF
Advanced methodologies resolving dimensionality complications for autism neur...
PPT
Teaching material agriculture food technology
PDF
TokAI - TikTok AI Agent : The First AI Application That Analyzes 10,000+ Vira...
PDF
AI And Its Effect On The Evolving IT Sector In Australia - Elevate
PDF
Diabetes mellitus diagnosis method based random forest with bat algorithm
PDF
NewMind AI Monthly Chronicles - July 2025
PDF
NewMind AI Weekly Chronicles - August'25 Week I
PDF
GamePlan Trading System Review: Professional Trader's Honest Take
PDF
Modernizing your data center with Dell and AMD
PDF
How UI/UX Design Impacts User Retention in Mobile Apps.pdf
PDF
Reach Out and Touch Someone: Haptics and Empathic Computing
PPTX
Cloud computing and distributed systems.
PDF
HCSP-Presales-Campus Network Planning and Design V1.0 Training Material-Witho...
solutions_manual_-_materials___processing_in_manufacturing__demargo_.pdf
madgavkar20181017ppt McKinsey Presentation.pdf
GDG Cloud Iasi [PUBLIC] Florian Blaga - Unveiling the Evolution of Cybersecur...
Blue Purple Modern Animated Computer Science Presentation.pdf.pdf
Detection-First SIEM: Rule Types, Dashboards, and Threat-Informed Strategy
Shreyas Phanse Resume: Experienced Backend Engineer | Java • Spring Boot • Ka...
cuic standard and advanced reporting.pdf
Advanced methodologies resolving dimensionality complications for autism neur...
Teaching material agriculture food technology
TokAI - TikTok AI Agent : The First AI Application That Analyzes 10,000+ Vira...
AI And Its Effect On The Evolving IT Sector In Australia - Elevate
Diabetes mellitus diagnosis method based random forest with bat algorithm
NewMind AI Monthly Chronicles - July 2025
NewMind AI Weekly Chronicles - August'25 Week I
GamePlan Trading System Review: Professional Trader's Honest Take
Modernizing your data center with Dell and AMD
How UI/UX Design Impacts User Retention in Mobile Apps.pdf
Reach Out and Touch Someone: Haptics and Empathic Computing
Cloud computing and distributed systems.
HCSP-Presales-Campus Network Planning and Design V1.0 Training Material-Witho...

Selenium Basics Tutorial

  • 1. Selenium Basics Workshop Frank Cohen, +01 (408) 871-0122, [email protected] April 20, 2011
  • 2. Open Source Test Automation About PushToTest ‣ Our Mission: Test, To Make A More Reliable World ‣ Make It Easier To Move From Manual To Automated Testing ‣ Support Advanced Testing, including Agile, Load, Integration ‣ Open Source Testing (OST) For Everyone 2
  • 3. Open Source Test Automation Today ‣ How To Use Selenium in Rich Internet Application (RIA, using Ajax) Environments ‣ How To Data Enable Selenium Tests Using TestMaker ‣ Testing in Flash/Flex Environments Using AMF Protocols ‣ Integrating TestMaker Tests Into Your Continuous Integration Environment ‣ How To Analyze Test Results Into Actionable Knowledge 3
  • 4. Open Source Test Automation Manual Testing Process Results 4 1 Recommend Changes Explore Manual Testing Tes 3 t 2 Plan 4 Run The Test Steps Create Test Plans
  • 5. Open Source Test Automation Side Effects ‣ Exhaustion ‣ Fatigue ‣ Blurry Vision ‣ Night Sweats ‣ Insanity ‣ Hair Loss ‣ Acne ‣ Divorce 5
  • 6. Open Source Test Automation OST Architecture Application Under Test PTTMonitor Web, RIA, BPM, SOA CPU, Net, Memory Functional Test Injector Test Authoring Test Bundles ScriptRunners Data Production Libraries SoapUI (Pro) MySQL, HtmlUnit Sahi, Selenium, SoapUI, Java csv files, rdbms queries Sahi (Pro) JUnit Class Framework Load Test Eclipse Java IDE Fitness Test Operation Console Languages: Java, Python Wiki Collaboration Production Designer Grid and Cloud Repository Results Analysis Record/Playback Test Deployment MySQL RDBMS Business Intelligence Tool Monitor Continuous Test Repository Bug Tracker Monitoring Integration Management 6
  • 7. Open Source Test Automation Selenium Browser Automation ‣ Selenium Core ‣ Selenium RC ‣ Selenium Grid ‣ Selenium IDE ‣ Selenium Domain Specific Language (DSL) 7
  • 8. Open Source Test Automation Selenium Architecture Selenium 1 Selenium 2 (WebDriver) Browser Browser iFrame Browser API Selenium Client Selenium RC Selenium Client Selenium Server Browserbot Application Under Test Application (AUT) Under Test (AUT) DOM DOM Javascript Javascript 8
  • 9. Open Source Test Automation Selenium Language Basics ‣ Page Commands ‣ Element Commands ‣ Validation Commands ‣ Assertion Commands ‣ Storage Commands 9
  • 10. Open Source Test Automation Selenium Locators ‣ Identifiers ‣ loginForm ‣ id=loginForm ‣ name=loginForm ‣ XPath (1.0 from W3C, no support of 2.0 and XQuery) ‣ Link Locator ‣ link=Continue <a href=”myurl”>Continue</a> ‣ DOM APIs ‣ dom=document.getElementById('loginForm') ‣ CSS Selectors 10 ‣ css=input.required[type="text"]
  • 11. Open Source Test Automation Event Handling and Ajax ‣ Selenium Tests Are Event Oriented ‣ Not Timing Oriented ‣ Ajax Web Objects ‣ Complicated Structures ‣ Dynamic Values ‣ Asynchronous Events ‣ No Standards ‣ Ajax Example 11
  • 12. Open Source Test Automation We Recommend Do Don’t Components Pause Record -> Script Use Static Values Dynamic Locators Storage Values Work With Devs Test and Trash Events Expect The Same 12
  • 13. Open Source Test Automation Flex, Flash Testing ‣ Extend the Selenium RC clients for adding Flash communication ‣ http://code.google.com/p/flex-ui-selenium/ ‣ http://code.google.com/p/flash-selenium/ public void sumForValidNumbers() { flexUITester.type("2").at("arg1"); flexUITester.type("3").at("arg2"); flexUITester.click("submit"); assertEquals("5", flexUITester.readFrom("result")); } ‣ Flex Automation API - Flexmonkium 13
  • 14. Open Source Test Automation TestMaker and Selenium Application Under Test TestNode Selenium RC SeleniumHtmlUnit Selenese Test TestMaker Console 14
  • 15. Open Source Test Automation TestMaker Object Designer ‣ Point-and-Click Functional Test Record/Playback ‣ Record Tests In IE, Chrome, Firefox, Safari, Opera ‣ Automatic Ajax Synchronization ‣ Drag-and-Drop Data Driven Testing ‣ Creates Selenium, Sahi, and Flex Tests 15
  • 16. Open Source Test Automation Resources ‣ http://www.pushtotest.com/ ‣ http://seleniumhq.org ‣ http://selenium.pushtotest.com ‣ http://refcardz.dzone.com/refcardz/getting-started-selenium ‣ http://refcardz.dzone.com/refcardz/getting-started-selenium-20 ‣ http://www.pushtotest.com/products-comparison ‣ http://www.pushtotest.com/selenium-conference-2011-analysis ‣ http://www.slideshare.net/frankcohen/selenium-xpath-performance- problems-in-ie 16
  • 17. Open Source Test Automation Where To Go From Here ‣ Watch A Screencast and Tutorial ‣ http://www.pushtotest.com/screencastcentral ‣ The Selenium Tutorial for Beginners ‣ http://www.pushtotest.com/selenium-webinar-series ‣ Attend An Open Source Test Workshop ‣ http://workshop.pushtotest.com ‣ Ask For A Proposal on Licenses, Training, Support, Consulting ‣ Call +01 408 871 0122, [email protected] 17