Automated Testing With Watir

Loading...

Flash Player 9 (or above) is needed to view presentations.
We have detected that you do not have it on your computer. To install it, go here.

0 comments

Post a comment

    Post a comment
    Embed Video
    Edit your comment Cancel

    4 Favorites

    Automated Testing With Watir - Presentation Transcript

    1. Automated Testing with WATIR Timothy Fisher
    2. What is WATIR?
      • W eb A pplication T esting I n R uby
      • Open-source Framework for browser-based automated testing.
      • Test scripts written in the Ruby programming language.
      • Natively supports IE
      • Extensions support Firefox and Safari
      • Pronounced like “water”
    3. Why use WATIR?
      • Ideal for functional or integration level testing.
      • Full power of Ruby available in test scripts.
      • Find bugs that unit tests miss.
      • Automates what is usually a manual tedious process.
      • More to come…
    4. WATIR Testimonials
      • A few testimonials from WATIR website:
        • watir rules. It easily outperformed every other automation tool we evaluated…
        • the most useful piece of software I’ve ever evaluated…
        • watir is by far the most complete web testing framework out there…
        • Watir is the most compelling alternative for filling the automated acceptance test need. (Ward Cunningham)
        • With watir, we are able to test with ease and ship with confidence.
      • And last but not least:
        • watir blew my freakin mind. Everything worked, no fuss, no muss, no bother.
        • I’m so happy to discover Ruby and Watir. I wanted to run around my office dancing and celebrating.
    5. WATIR Examples
      • ie.link(:id, “lnk1”).click
      • ie.button(:id, “btn1”).click
      • ie.link(:name, “lnk1”).exists?
      • ie.contains_text(‘Welcome’)
      • wait_until {@browser.contains_text “Edit"}
      • WATIR can find elements by id, name, text, link, XPath, etc…
      • WATIR uses the OLE/COM automation interface to control the browser.
    6. Creating a Test DSL with WATIR
      • What is a DSL?
        • Domain Specific Language
        • a language designed for a specific domain
      • Testing DSL
        • A language design specifically for browser-based testing.
    7. Test Framework Test Scripts App Specific Test DSL WATIR Test Framework Ruby run-time
    8. Test Script Example
      • launch_myapp ENVIRONMENT, :port=>PORT
      • login_as USERNAME, PASSWORD
      • goto_page :configuration
      • select_tab :partners
      • add_new_partner :label=>'TestPartner'
      • save_configuration
      Test Scripts
    9. DSL Example
      • def login_as(user, password)
      • # enter user name and password
      • @browser.text_field(:name, 'member_name').set(user)
      • @browser.text_field(:name,'member_password').set(password)
      • # submit login form
      • @browser.form(:id, 'formLogin').submit
      • @browser.wait
      • # verify you have reached the welcome page
      • assert @browser.contains_text("Catalog Data Quick Overview")
      • puts "Successfully logged in."
      • end
      Test Scripts App Specific Test DSL
    10. Observations
      • Test scripts use very simple application targeted language.
      • Only DSL implementation uses WATIR API
      • With training QA could write test scripts.
    11. Test Scripts Everywhere…
      • Test scripts can be written before development.
        • practice test-driven development.
        • embed in Use Cases to achieve testable use cases, executable specifications.
      • Defects can be described using a Test Script that reproduces the defect.
        • attach script to bugzilla defect.
    12. Recording Scripts
      • Watir Recorder++
      • Firewatir Recorder
        • Records user action while user is interacting with the application
        • User TestGen4Web XPI for capturing user actions
        • Convert user actions to XML
        • Convert XML to ruby file for playback using tg4rb gem
    13. WATIR Alternatives
      • Selenium
        • Similar open source browser automation framework.
        • Scripts are written in custom macro language.
      • Commercial Products
        • Compuware TestPartner
        • Usually based on record-playback techniques
    14. References
      • Watir http://wtr.rubyforge.org
      • Firewatir http://code.google.com/p/firewatir
      • tg4rb http://code.google.com/p/tg4rb
      • TestGen4Web http://developer.spikesource.com/wiki/index.php/Projects:TestGen4Web
      • Selenium http://www.openqa.org/selenium/
      • Compuware TestPartner http://www.compuware.com/products/qacenter/375_ENG_HTML.htm

    + Timothy FisherTimothy Fisher, 3 years ago

    custom

    6336 views, 4 favs, 2 embeds more stats

    An overview of using the Watir testing framework to more

    More info about this document

    © All Rights Reserved

    Go to text version

    • Total Views 6336
      • 6327 on SlideShare
      • 9 from embeds
    • Comments 0
    • Favorites 4
    • Downloads 253
    Most viewed embeds
    • 8 views on http://open-source-testing.blogspot.com
    • 1 views on file://

    more

    All embeds
    • 8 views on http://open-source-testing.blogspot.com
    • 1 views on file://

    less

    Flagged as inappropriate Flag as inappropriate
    Flag as inappropriate

    Select your reason for flagging this presentation as inappropriate. If needed, use the feedback form to let us know more details.

    Cancel
    File a copyright complaint
    Having problems? Go to our helpdesk?

    Categories