SlideShare una empresa de Scribd logo
1 de 18
Descargar para leer sin conexión
Intro
          * I’m Dave Haeffner                                Show of hands
          * I’ve been doing QA and automated                 new to Selenium?
          web testing for 4 years                            some experience with?
          * Most of that time was spent at                   experienced?
          The Motley Fool
          * More recently I started my own                   new to programming?
          consulting company and work with                   some experience with?
          soft ware development shops to help                experienced?
          them with QA strategy and                          not sure how to answer?
          implementing automated web
          testing




                                   SELENIUM BASICS
                                      brought to you by the QA Lounge




Tuesday, September 25, 12
“WHAT IS SELENIUM? TELL
                    ME LIKE I’M 5.”
                               Selenium is a soft ware
                               robot sent from the
                               future to test our
                               soft ware.




Tuesday, September 25, 12
PREFACE

          There are many ways to implement Selenium & a framework

                            I will show you one that has worked for me

                            There will be code involved (and opinions!)

         These examples do not reflect a comprehensive QA strategy

                                       But it’s a good start


Tuesday, September 25, 12
SELENIUM IDE
                                    I debated showing you the IDE since it’s the unloved
                                    child of the Selenium community.

                                    But it is responsible for the wide spread success of
                                    Selenium.

                                    I consider it to be less of an unloved orphan and
                                    more of a gateway drug




Tuesday, September 25, 12
SELENIUM IDIOMS


    • Verify           vs. Assert

    • Location, location, location!

    • ClickAndWait, and             wait, and wait...




Tuesday, September 25, 12
LET ME EXPLAIN

    • Ruby            is approachable -- it can read like English

    • There’s                also that “standing on the shoulder of giants thing”

    • RSpec                 is an open-source testing tool built in Ruby for Ruby

         • It’s      kind of a big deal

         • Loads             of functionality out of the box

         • Quite             customizable

Tuesday, September 25, 12
“SHUT UP AND SHOW
                           ME THE CODE!”



Tuesday, September 25, 12
COMMON ACTIONS

                      Name                Action            Sub-Action
                       get             fetch a page
                     navigate          same as get        to, forward, back
                               (:id, “idtext”)
                               (:class, “classtext”)
                               (:tag_name, “tagtext”)
           find_element
                               (:name, “nametext”)           click, text
      (a.k.a. “by” strategies)
                               (:link, “linktext”)
                               (:partial_link_text, “”)
                               (:css, “csstext”)

Tuesday, September 25, 12
HONORABLE MENTION

    • Moving                between windows and frames

    • Pop-up                dialogs

    • Drag            and Drop

    • Cookies

    • Changing                the User Agent


Tuesday, September 25, 12
ASSERTIONS THRU RSPEC
                            Thing      Action         Sub-Action
                                                     include(“text”)
                                                   start_with(“text”)
                                                   end_with(“text”)
                                                    equal(expected)
                                       should         be(expected)
                            object
                                     should_not      be > expected
                                                    be >= expected
                                                    be <= expected
                                                     be < expected
                                                  match(/expression/)

Tuesday, September 25, 12
“NO REALLY,
                 SHUT UP AND SHOW ME
                      THE CODE!”



Tuesday, September 25, 12
PAGE OBJECT PATTERN
                                                         Create a class
                                                         Pass the session to it
                                                         Store and use it through an instance variable
                                                         Assertions done outside of the class
    • Relieves              many test maintenance woes

    • Keeps             things DRY rather than WET

    • Create   an object that represents a page (or component of a
        page) and test against that

    • If    the UI changes, you change just the object, not the tests

    • Also           helps you make things more readable

Tuesday, September 25, 12
“IS THAT IT?”




Tuesday, September 25, 12
robot/
                                                 DIY FRAMEWORK
                     .rspec
                     Rakefile
                     Gemfile
                     art/
                            results.html
                     brains/
                            config.rb
                            page_objects/
                              google_search.rb
                     guts/



Tuesday, September 25, 12
FRAMEWORK CONT’D

                            rake robot:run




      Code available at github.com/tourdedave/diy_framework



Tuesday, September 25, 12
RECAP

    • Selenium                IDE is cool in theory...

    • WebDriver                 is cool.

    • The          Page Object Pattern will make you happy and successful

    • Rolling               your own framework is within your grasp

    • And           it positions you for automation success!


Tuesday, September 25, 12
SOME RESOURCES
    • Selenium                HQ (SeleniumHQ.com/docs/03_webdriver.html)

    • Official               Selenium Blog (SeleniumHQ.Wordpress.com)

    • Ruby            Selenium Bindings (http://bit.ly/seruby)

    • RSpec                 (http://github.com/rspec)

    • Why             Everyone Should Be Code Literate (http://bit.ly/sauceio)

    •A        book to get you started (http://bit.ly/se2book)

    •A        self-proclaimed great resource* (QA-Lounge.com)
Tuesday, September 25, 12
Q&A

                            @TourDeDave
                            QA-Lounge.com



Tuesday, September 25, 12

Más contenido relacionado

Destacado

Cucumber Crash Course
Cucumber Crash CourseCucumber Crash Course
Cucumber Crash CourseDave Haeffner
 
Open Source Investing
Open Source InvestingOpen Source Investing
Open Source InvestingDave Haeffner
 
How To Find Information On Your Own
How To Find Information On Your OwnHow To Find Information On Your Own
How To Find Information On Your OwnDave Haeffner
 
How To Use Selenium Successfully (Java Edition)
How To Use Selenium Successfully (Java Edition)How To Use Selenium Successfully (Java Edition)
How To Use Selenium Successfully (Java Edition)Dave Haeffner
 
Selenium Tips & Tricks
Selenium Tips & TricksSelenium Tips & Tricks
Selenium Tips & TricksDave Haeffner
 
Selenium Tips & Tricks, presented at the Tel Aviv Selenium Meetup
Selenium Tips & Tricks, presented at the Tel Aviv Selenium MeetupSelenium Tips & Tricks, presented at the Tel Aviv Selenium Meetup
Selenium Tips & Tricks, presented at the Tel Aviv Selenium MeetupDave Haeffner
 
Pivotal Failure - Lessons Learned from Lean Startup Machine DC
Pivotal Failure - Lessons Learned from Lean Startup Machine DCPivotal Failure - Lessons Learned from Lean Startup Machine DC
Pivotal Failure - Lessons Learned from Lean Startup Machine DCDave Haeffner
 
Web testing with Selenium
Web testing with SeleniumWeb testing with Selenium
Web testing with SeleniumXBOSoft
 
Continuous Testing Meets the Classroom at Code.org
Continuous Testing Meets the Classroom at Code.orgContinuous Testing Meets the Classroom at Code.org
Continuous Testing Meets the Classroom at Code.orgSauce Labs
 
Web ui tests examples with selenide, nselene, selene & capybara
Web ui tests examples with  selenide, nselene, selene & capybaraWeb ui tests examples with  selenide, nselene, selene & capybara
Web ui tests examples with selenide, nselene, selene & capybaraIakiv Kramarenko
 
You do not need automation engineer - Sqa Days - 2015 - EN
You do not need automation engineer  - Sqa Days - 2015 - ENYou do not need automation engineer  - Sqa Days - 2015 - EN
You do not need automation engineer - Sqa Days - 2015 - ENIakiv Kramarenko
 
Cross Platform Appium Tests: How To
Cross Platform Appium Tests: How ToCross Platform Appium Tests: How To
Cross Platform Appium Tests: How ToGlobalLogic Ukraine
 
Polyglot automation - QA Fest - 2015
Polyglot automation - QA Fest - 2015Polyglot automation - QA Fest - 2015
Polyglot automation - QA Fest - 2015Iakiv Kramarenko
 
Three Simple Chords of Alternative PageObjects and Hardcore of LoadableCompon...
Three Simple Chords of Alternative PageObjects and Hardcore of LoadableCompon...Three Simple Chords of Alternative PageObjects and Hardcore of LoadableCompon...
Three Simple Chords of Alternative PageObjects and Hardcore of LoadableCompon...Iakiv Kramarenko
 
Write Selenide in Python 15 min
Write Selenide in Python 15 minWrite Selenide in Python 15 min
Write Selenide in Python 15 minIakiv Kramarenko
 

Destacado (18)

Cucumber Crash Course
Cucumber Crash CourseCucumber Crash Course
Cucumber Crash Course
 
Open Source Investing
Open Source InvestingOpen Source Investing
Open Source Investing
 
Selenium Frameworks
Selenium FrameworksSelenium Frameworks
Selenium Frameworks
 
How To Find Information On Your Own
How To Find Information On Your OwnHow To Find Information On Your Own
How To Find Information On Your Own
 
How To Use Selenium Successfully (Java Edition)
How To Use Selenium Successfully (Java Edition)How To Use Selenium Successfully (Java Edition)
How To Use Selenium Successfully (Java Edition)
 
Selenium Tips & Tricks
Selenium Tips & TricksSelenium Tips & Tricks
Selenium Tips & Tricks
 
Selenium Tips & Tricks, presented at the Tel Aviv Selenium Meetup
Selenium Tips & Tricks, presented at the Tel Aviv Selenium MeetupSelenium Tips & Tricks, presented at the Tel Aviv Selenium Meetup
Selenium Tips & Tricks, presented at the Tel Aviv Selenium Meetup
 
Pivotal Failure - Lessons Learned from Lean Startup Machine DC
Pivotal Failure - Lessons Learned from Lean Startup Machine DCPivotal Failure - Lessons Learned from Lean Startup Machine DC
Pivotal Failure - Lessons Learned from Lean Startup Machine DC
 
Web testing with Selenium
Web testing with SeleniumWeb testing with Selenium
Web testing with Selenium
 
Continuous Testing Meets the Classroom at Code.org
Continuous Testing Meets the Classroom at Code.orgContinuous Testing Meets the Classroom at Code.org
Continuous Testing Meets the Classroom at Code.org
 
Selenium
SeleniumSelenium
Selenium
 
KISS Automation.py
KISS Automation.pyKISS Automation.py
KISS Automation.py
 
Web ui tests examples with selenide, nselene, selene & capybara
Web ui tests examples with  selenide, nselene, selene & capybaraWeb ui tests examples with  selenide, nselene, selene & capybara
Web ui tests examples with selenide, nselene, selene & capybara
 
You do not need automation engineer - Sqa Days - 2015 - EN
You do not need automation engineer  - Sqa Days - 2015 - ENYou do not need automation engineer  - Sqa Days - 2015 - EN
You do not need automation engineer - Sqa Days - 2015 - EN
 
Cross Platform Appium Tests: How To
Cross Platform Appium Tests: How ToCross Platform Appium Tests: How To
Cross Platform Appium Tests: How To
 
Polyglot automation - QA Fest - 2015
Polyglot automation - QA Fest - 2015Polyglot automation - QA Fest - 2015
Polyglot automation - QA Fest - 2015
 
Three Simple Chords of Alternative PageObjects and Hardcore of LoadableCompon...
Three Simple Chords of Alternative PageObjects and Hardcore of LoadableCompon...Three Simple Chords of Alternative PageObjects and Hardcore of LoadableCompon...
Three Simple Chords of Alternative PageObjects and Hardcore of LoadableCompon...
 
Write Selenide in Python 15 min
Write Selenide in Python 15 minWrite Selenide in Python 15 min
Write Selenide in Python 15 min
 

Similar a Introduction to Selenium Basics

Symfony - Introduction
Symfony - IntroductionSymfony - Introduction
Symfony - IntroductionPiers Warmers
 
Flaky No More: Find the Right Framework for Your Selenium Tests
Flaky No More: Find the Right Framework for Your Selenium TestsFlaky No More: Find the Right Framework for Your Selenium Tests
Flaky No More: Find the Right Framework for Your Selenium TestsTechWell
 
Property-Based Testing for Services
Property-Based Testing for ServicesProperty-Based Testing for Services
Property-Based Testing for Servicesjessitron
 
Products = Mess - How to avoid it? By Suman Mukherjee
Products = Mess - How to avoid it?  By Suman MukherjeeProducts = Mess - How to avoid it?  By Suman Mukherjee
Products = Mess - How to avoid it? By Suman MukherjeeWebGeek Philippines
 
Zero to tested
Zero to testedZero to tested
Zero to testedMagenTys
 
Selenium + Specflow
Selenium + SpecflowSelenium + Specflow
Selenium + Specflowcromwellryan
 
From 0 to 100: How we jump-started our frontend testing
From 0 to 100: How we jump-started our frontend testingFrom 0 to 100: How we jump-started our frontend testing
From 0 to 100: How we jump-started our frontend testingHenning Muszynski
 
Ruby Metaprogramming - OSCON 2008
Ruby Metaprogramming - OSCON 2008Ruby Metaprogramming - OSCON 2008
Ruby Metaprogramming - OSCON 2008Brian Sam-Bodden
 
Method Swizzling with Objective-C
Method Swizzling with Objective-CMethod Swizzling with Objective-C
Method Swizzling with Objective-CAdamFallon4
 
Test automation with selenide
Test automation with selenideTest automation with selenide
Test automation with selenideIsuru Madanayaka
 
Cucumber Presentation Kiev Meet Up
Cucumber Presentation Kiev Meet UpCucumber Presentation Kiev Meet Up
Cucumber Presentation Kiev Meet Updimakovalenko
 
Selenium and Cucumber Selenium Conf 2011
Selenium and Cucumber Selenium Conf 2011Selenium and Cucumber Selenium Conf 2011
Selenium and Cucumber Selenium Conf 2011dimakovalenko
 
Automated UI Testing Done Right (QMSDNUG)
Automated UI Testing Done Right (QMSDNUG)Automated UI Testing Done Right (QMSDNUG)
Automated UI Testing Done Right (QMSDNUG)Mehdi Khalili
 
TripCase Unit Testing with Jasmine
TripCase Unit Testing with JasmineTripCase Unit Testing with Jasmine
TripCase Unit Testing with JasmineStephen Pond
 
Responsive widget-design-with-word press
Responsive widget-design-with-word pressResponsive widget-design-with-word press
Responsive widget-design-with-word pressWes Chyrchel
 
#SPSEMEA SharePoint & jQuery - What I wish I would have known a year ago..
#SPSEMEA SharePoint & jQuery - What I wish I would have known a year ago..#SPSEMEA SharePoint & jQuery - What I wish I would have known a year ago..
#SPSEMEA SharePoint & jQuery - What I wish I would have known a year ago..Mark Rackley
 
Workshop: Introduction to the Disruptor
Workshop: Introduction to the DisruptorWorkshop: Introduction to the Disruptor
Workshop: Introduction to the DisruptorTrisha Gee
 

Similar a Introduction to Selenium Basics (20)

Symfony - Introduction
Symfony - IntroductionSymfony - Introduction
Symfony - Introduction
 
Flaky No More: Find the Right Framework for Your Selenium Tests
Flaky No More: Find the Right Framework for Your Selenium TestsFlaky No More: Find the Right Framework for Your Selenium Tests
Flaky No More: Find the Right Framework for Your Selenium Tests
 
Property-Based Testing for Services
Property-Based Testing for ServicesProperty-Based Testing for Services
Property-Based Testing for Services
 
Products = Mess - How to avoid it? By Suman Mukherjee
Products = Mess - How to avoid it?  By Suman MukherjeeProducts = Mess - How to avoid it?  By Suman Mukherjee
Products = Mess - How to avoid it? By Suman Mukherjee
 
Zero to tested
Zero to testedZero to tested
Zero to tested
 
Selenium + Specflow
Selenium + SpecflowSelenium + Specflow
Selenium + Specflow
 
From 0 to 100: How we jump-started our frontend testing
From 0 to 100: How we jump-started our frontend testingFrom 0 to 100: How we jump-started our frontend testing
From 0 to 100: How we jump-started our frontend testing
 
Gemboys
GemboysGemboys
Gemboys
 
Ruby Metaprogramming - OSCON 2008
Ruby Metaprogramming - OSCON 2008Ruby Metaprogramming - OSCON 2008
Ruby Metaprogramming - OSCON 2008
 
Method Swizzling with Objective-C
Method Swizzling with Objective-CMethod Swizzling with Objective-C
Method Swizzling with Objective-C
 
Test automation with selenide
Test automation with selenideTest automation with selenide
Test automation with selenide
 
Cucumber Presentation Kiev Meet Up
Cucumber Presentation Kiev Meet UpCucumber Presentation Kiev Meet Up
Cucumber Presentation Kiev Meet Up
 
Selenium and Cucumber Selenium Conf 2011
Selenium and Cucumber Selenium Conf 2011Selenium and Cucumber Selenium Conf 2011
Selenium and Cucumber Selenium Conf 2011
 
Berlin.JS Meetup
Berlin.JS MeetupBerlin.JS Meetup
Berlin.JS Meetup
 
Automated UI Testing Done Right (QMSDNUG)
Automated UI Testing Done Right (QMSDNUG)Automated UI Testing Done Right (QMSDNUG)
Automated UI Testing Done Right (QMSDNUG)
 
TripCase Unit Testing with Jasmine
TripCase Unit Testing with JasmineTripCase Unit Testing with Jasmine
TripCase Unit Testing with Jasmine
 
Responsive widget-design-with-word press
Responsive widget-design-with-word pressResponsive widget-design-with-word press
Responsive widget-design-with-word press
 
#SPSEMEA SharePoint & jQuery - What I wish I would have known a year ago..
#SPSEMEA SharePoint & jQuery - What I wish I would have known a year ago..#SPSEMEA SharePoint & jQuery - What I wish I would have known a year ago..
#SPSEMEA SharePoint & jQuery - What I wish I would have known a year ago..
 
Workshop: Introduction to the Disruptor
Workshop: Introduction to the DisruptorWorkshop: Introduction to the Disruptor
Workshop: Introduction to the Disruptor
 
Running a Lean Startup with AWS
Running a Lean Startup with AWSRunning a Lean Startup with AWS
Running a Lean Startup with AWS
 

Último

Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptxUse of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptxLoriGlavin3
 
UiPath Community: Communication Mining from Zero to Hero
UiPath Community: Communication Mining from Zero to HeroUiPath Community: Communication Mining from Zero to Hero
UiPath Community: Communication Mining from Zero to HeroUiPathCommunity
 
The State of Passkeys with FIDO Alliance.pptx
The State of Passkeys with FIDO Alliance.pptxThe State of Passkeys with FIDO Alliance.pptx
The State of Passkeys with FIDO Alliance.pptxLoriGlavin3
 
2024 April Patch Tuesday
2024 April Patch Tuesday2024 April Patch Tuesday
2024 April Patch TuesdayIvanti
 
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptxMerck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptxLoriGlavin3
 
[Webinar] SpiraTest - Setting New Standards in Quality Assurance
[Webinar] SpiraTest - Setting New Standards in Quality Assurance[Webinar] SpiraTest - Setting New Standards in Quality Assurance
[Webinar] SpiraTest - Setting New Standards in Quality AssuranceInflectra
 
Potential of AI (Generative AI) in Business: Learnings and Insights
Potential of AI (Generative AI) in Business: Learnings and InsightsPotential of AI (Generative AI) in Business: Learnings and Insights
Potential of AI (Generative AI) in Business: Learnings and InsightsRavi Sanghani
 
So einfach geht modernes Roaming fuer Notes und Nomad.pdf
So einfach geht modernes Roaming fuer Notes und Nomad.pdfSo einfach geht modernes Roaming fuer Notes und Nomad.pdf
So einfach geht modernes Roaming fuer Notes und Nomad.pdfpanagenda
 
Unleashing Real-time Insights with ClickHouse_ Navigating the Landscape in 20...
Unleashing Real-time Insights with ClickHouse_ Navigating the Landscape in 20...Unleashing Real-time Insights with ClickHouse_ Navigating the Landscape in 20...
Unleashing Real-time Insights with ClickHouse_ Navigating the Landscape in 20...Alkin Tezuysal
 
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptxThe Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptxLoriGlavin3
 
Genislab builds better products and faster go-to-market with Lean project man...
Genislab builds better products and faster go-to-market with Lean project man...Genislab builds better products and faster go-to-market with Lean project man...
Genislab builds better products and faster go-to-market with Lean project man...Farhan Tariq
 
How to write a Business Continuity Plan
How to write a Business Continuity PlanHow to write a Business Continuity Plan
How to write a Business Continuity PlanDatabarracks
 
What is DBT - The Ultimate Data Build Tool.pdf
What is DBT - The Ultimate Data Build Tool.pdfWhat is DBT - The Ultimate Data Build Tool.pdf
What is DBT - The Ultimate Data Build Tool.pdfMounikaPolabathina
 
Enhancing User Experience - Exploring the Latest Features of Tallyman Axis Lo...
Enhancing User Experience - Exploring the Latest Features of Tallyman Axis Lo...Enhancing User Experience - Exploring the Latest Features of Tallyman Axis Lo...
Enhancing User Experience - Exploring the Latest Features of Tallyman Axis Lo...Scott Andery
 
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024BookNet Canada
 
Emixa Mendix Meetup 11 April 2024 about Mendix Native development
Emixa Mendix Meetup 11 April 2024 about Mendix Native developmentEmixa Mendix Meetup 11 April 2024 about Mendix Native development
Emixa Mendix Meetup 11 April 2024 about Mendix Native developmentPim van der Noll
 
Decarbonising Buildings: Making a net-zero built environment a reality
Decarbonising Buildings: Making a net-zero built environment a realityDecarbonising Buildings: Making a net-zero built environment a reality
Decarbonising Buildings: Making a net-zero built environment a realityIES VE
 
How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.Curtis Poe
 
From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .Alan Dix
 
Moving Beyond Passwords: FIDO Paris Seminar.pdf
Moving Beyond Passwords: FIDO Paris Seminar.pdfMoving Beyond Passwords: FIDO Paris Seminar.pdf
Moving Beyond Passwords: FIDO Paris Seminar.pdfLoriGlavin3
 

Último (20)

Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptxUse of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
 
UiPath Community: Communication Mining from Zero to Hero
UiPath Community: Communication Mining from Zero to HeroUiPath Community: Communication Mining from Zero to Hero
UiPath Community: Communication Mining from Zero to Hero
 
The State of Passkeys with FIDO Alliance.pptx
The State of Passkeys with FIDO Alliance.pptxThe State of Passkeys with FIDO Alliance.pptx
The State of Passkeys with FIDO Alliance.pptx
 
2024 April Patch Tuesday
2024 April Patch Tuesday2024 April Patch Tuesday
2024 April Patch Tuesday
 
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptxMerck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptx
 
[Webinar] SpiraTest - Setting New Standards in Quality Assurance
[Webinar] SpiraTest - Setting New Standards in Quality Assurance[Webinar] SpiraTest - Setting New Standards in Quality Assurance
[Webinar] SpiraTest - Setting New Standards in Quality Assurance
 
Potential of AI (Generative AI) in Business: Learnings and Insights
Potential of AI (Generative AI) in Business: Learnings and InsightsPotential of AI (Generative AI) in Business: Learnings and Insights
Potential of AI (Generative AI) in Business: Learnings and Insights
 
So einfach geht modernes Roaming fuer Notes und Nomad.pdf
So einfach geht modernes Roaming fuer Notes und Nomad.pdfSo einfach geht modernes Roaming fuer Notes und Nomad.pdf
So einfach geht modernes Roaming fuer Notes und Nomad.pdf
 
Unleashing Real-time Insights with ClickHouse_ Navigating the Landscape in 20...
Unleashing Real-time Insights with ClickHouse_ Navigating the Landscape in 20...Unleashing Real-time Insights with ClickHouse_ Navigating the Landscape in 20...
Unleashing Real-time Insights with ClickHouse_ Navigating the Landscape in 20...
 
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptxThe Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
 
Genislab builds better products and faster go-to-market with Lean project man...
Genislab builds better products and faster go-to-market with Lean project man...Genislab builds better products and faster go-to-market with Lean project man...
Genislab builds better products and faster go-to-market with Lean project man...
 
How to write a Business Continuity Plan
How to write a Business Continuity PlanHow to write a Business Continuity Plan
How to write a Business Continuity Plan
 
What is DBT - The Ultimate Data Build Tool.pdf
What is DBT - The Ultimate Data Build Tool.pdfWhat is DBT - The Ultimate Data Build Tool.pdf
What is DBT - The Ultimate Data Build Tool.pdf
 
Enhancing User Experience - Exploring the Latest Features of Tallyman Axis Lo...
Enhancing User Experience - Exploring the Latest Features of Tallyman Axis Lo...Enhancing User Experience - Exploring the Latest Features of Tallyman Axis Lo...
Enhancing User Experience - Exploring the Latest Features of Tallyman Axis Lo...
 
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
 
Emixa Mendix Meetup 11 April 2024 about Mendix Native development
Emixa Mendix Meetup 11 April 2024 about Mendix Native developmentEmixa Mendix Meetup 11 April 2024 about Mendix Native development
Emixa Mendix Meetup 11 April 2024 about Mendix Native development
 
Decarbonising Buildings: Making a net-zero built environment a reality
Decarbonising Buildings: Making a net-zero built environment a realityDecarbonising Buildings: Making a net-zero built environment a reality
Decarbonising Buildings: Making a net-zero built environment a reality
 
How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.
 
From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .
 
Moving Beyond Passwords: FIDO Paris Seminar.pdf
Moving Beyond Passwords: FIDO Paris Seminar.pdfMoving Beyond Passwords: FIDO Paris Seminar.pdf
Moving Beyond Passwords: FIDO Paris Seminar.pdf
 

Introduction to Selenium Basics

  • 1. Intro * I’m Dave Haeffner Show of hands * I’ve been doing QA and automated new to Selenium? web testing for 4 years some experience with? * Most of that time was spent at experienced? The Motley Fool * More recently I started my own new to programming? consulting company and work with some experience with? soft ware development shops to help experienced? them with QA strategy and not sure how to answer? implementing automated web testing SELENIUM BASICS brought to you by the QA Lounge Tuesday, September 25, 12
  • 2. “WHAT IS SELENIUM? TELL ME LIKE I’M 5.” Selenium is a soft ware robot sent from the future to test our soft ware. Tuesday, September 25, 12
  • 3. PREFACE There are many ways to implement Selenium & a framework I will show you one that has worked for me There will be code involved (and opinions!) These examples do not reflect a comprehensive QA strategy But it’s a good start Tuesday, September 25, 12
  • 4. SELENIUM IDE I debated showing you the IDE since it’s the unloved child of the Selenium community. But it is responsible for the wide spread success of Selenium. I consider it to be less of an unloved orphan and more of a gateway drug Tuesday, September 25, 12
  • 5. SELENIUM IDIOMS • Verify vs. Assert • Location, location, location! • ClickAndWait, and wait, and wait... Tuesday, September 25, 12
  • 6. LET ME EXPLAIN • Ruby is approachable -- it can read like English • There’s also that “standing on the shoulder of giants thing” • RSpec is an open-source testing tool built in Ruby for Ruby • It’s kind of a big deal • Loads of functionality out of the box • Quite customizable Tuesday, September 25, 12
  • 7. “SHUT UP AND SHOW ME THE CODE!” Tuesday, September 25, 12
  • 8. COMMON ACTIONS Name Action Sub-Action get fetch a page navigate same as get to, forward, back (:id, “idtext”) (:class, “classtext”) (:tag_name, “tagtext”) find_element (:name, “nametext”) click, text (a.k.a. “by” strategies) (:link, “linktext”) (:partial_link_text, “”) (:css, “csstext”) Tuesday, September 25, 12
  • 9. HONORABLE MENTION • Moving between windows and frames • Pop-up dialogs • Drag and Drop • Cookies • Changing the User Agent Tuesday, September 25, 12
  • 10. ASSERTIONS THRU RSPEC Thing Action Sub-Action include(“text”) start_with(“text”) end_with(“text”) equal(expected) should be(expected) object should_not be > expected be >= expected be <= expected be < expected match(/expression/) Tuesday, September 25, 12
  • 11. “NO REALLY, SHUT UP AND SHOW ME THE CODE!” Tuesday, September 25, 12
  • 12. PAGE OBJECT PATTERN Create a class Pass the session to it Store and use it through an instance variable Assertions done outside of the class • Relieves many test maintenance woes • Keeps things DRY rather than WET • Create an object that represents a page (or component of a page) and test against that • If the UI changes, you change just the object, not the tests • Also helps you make things more readable Tuesday, September 25, 12
  • 13. “IS THAT IT?” Tuesday, September 25, 12
  • 14. robot/ DIY FRAMEWORK .rspec Rakefile Gemfile art/ results.html brains/ config.rb page_objects/ google_search.rb guts/ Tuesday, September 25, 12
  • 15. FRAMEWORK CONT’D rake robot:run Code available at github.com/tourdedave/diy_framework Tuesday, September 25, 12
  • 16. RECAP • Selenium IDE is cool in theory... • WebDriver is cool. • The Page Object Pattern will make you happy and successful • Rolling your own framework is within your grasp • And it positions you for automation success! Tuesday, September 25, 12
  • 17. SOME RESOURCES • Selenium HQ (SeleniumHQ.com/docs/03_webdriver.html) • Official Selenium Blog (SeleniumHQ.Wordpress.com) • Ruby Selenium Bindings (http://bit.ly/seruby) • RSpec (http://github.com/rspec) • Why Everyone Should Be Code Literate (http://bit.ly/sauceio) •A book to get you started (http://bit.ly/se2book) •A self-proclaimed great resource* (QA-Lounge.com) Tuesday, September 25, 12
  • 18. Q&A @TourDeDave QA-Lounge.com Tuesday, September 25, 12