Alister Scott @ Australian Test Automation Workshop TAW 2009

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

    Favorites, Groups & Events

    Alister Scott @ Australian Test Automation Workshop TAW 2009 - Presentation Transcript

    1. using Watir to create a super easy, highly maintainable, business-focused framework (for free ! ) Alister Scott
    2. About Me   Testing Team Leader QSuper Limited   Wiki Master Watir Open Source Project
    3. About Watir Web Application Testing in Ruby An open source (BSD) ruby library for automating browsers (that rocks!) Built for ease of use An active & friendly community
    4. About Watir No need for server side stuff No need for java stuff, pure ruby Need a test execution/assertion library Test::Unit is the ruby default RSpec is another Cucumber is hip No red button (use irb instead!)
    5.  
    6. A tale of two frameworks the ' all spreadsheet ' way easy for business to understand; but difficult for us to maintain! generally discourage re-use and efficient coding practices
    7. A tale of two frameworks the ' all code ' way easy for us to maintain; but difficult for business to understand; generally difficult to express business scenarios ( but cucumber makes it easier )
    8. A better way? What about an in-between?
    9. Test case design is done in spreadsheets (easy for testers/business ppl) Test execution design is done in code (easy for automated testers)
    10. Creating an in-between framework using Watir , and roo
    11. Not another google example You specifically agree not to access (or attempt to access) any of the Services through any automated means (including use of scripts or web crawlers)
    12. A business focused data sheet test case design Function Test Comments Expected Outcome Expected Error Customer Empty Cart Success Function Test Comments Expected Outcome Expected Error Book Title Customer Add Book Negative Test Error Could not locate title in store Ruby on Rails Customer Add Book Success Pragmatic Unit Testing (C#) Function Test Comments Expected Outcome Expected Error Expect Cart Total Customer Check Cart Total Success 59.9
    13. Business scenarios calls Customer.add_book( “ Ruby on Rails ” ) Function Test Comments Expected Outcome Expected Error Customer Empty Cart Success Function Test Comments Expected Outcome Expected Error Book Title Customer Add Book Negative Test Error Could not locate title in store Ruby on Rails Customer Add Book Success Pragmatic Unit Testing (C#) Function Test Comments Expected Outcome Expected Error Expect Cart Total Customer Check Cart Total Success 59.9
    14. Customer.add_book(book_title) test execution design def Customer.add_book(book_title) browser = Common.find_or_start_store(TITLE, URL) # Check if title is already in cart - so we can check it was added correctly browser.link(:text,'Show my cart').click prev_cart_count = 0 prev_cart_total = 0.00 if not browser.div(:text,'Your cart is currently empty').exist? then # We have a non-empty cart for row in browser.table(:index,1) if row[2].text == book_title then prev_cart_count = row[1].text.to_i break end end prev_cart_total = browser.cell(:id, 'totalcell').text[1..-1].to_f #remove $ sign browser.link(:text, 'Continue shopping').click end
    15. Why separate test case & test execution design? we can change either without updating both (add test cases without writing code) we can change test execution without changing our existing test cases (new interface, move to SOA)
    16. This could just as easily test a SOA calls CustomerAddBook SOAP web service Function Test Comments Expected Outcome Expected Error Customer Empty Cart Success Function Test Comments Expected Outcome Expected Error Book Title Customer Add Book Negative Test Error Could not locate title in store Ruby on Rails Customer Add Book Success Pragmatic Unit Testing (C#) Function Test Comments Expected Outcome Expected Error Expect Cart Total Customer Check Cart Total Success 59.9
    17. but... could this test a SOA? Test: Add Book Open http://localhost:3000/store VerifyTitle Book Store Find Ruby On Rails Type Quantity 1 Click CartB combined test case & test execution design Be ready for change
    18. Gluing a datasheet to watir excel = WIN32OLE::new('excel.Application') computer says no... Use roo instead roo = open source, cross platform, ruby library for reading spreadsheets .xls, .ods, gDocs reads file content, works linux, mac no excel license needed, use openoffice
    19. Gluing a datasheet to watir case ARGV[0] when "excel" @ss = Excel.new("watir.xls") when "gdocs" @ss = Google.new("0Au9u3") else @ss Openoffice.new("watir.ods") end end @ss.first_row.upto(@ss.last_row) do |row| # Run each test end
    20. live demo
    21. “ Share your knowledge. It ’ s a way to achieve immortality. ” ~ The Dalai Lama
    22. me:   watirmelon.com watir: watir.com
    SlideShare Zeitgeist 2009

    + Alister ScottAlister Scott Nominate

    custom

    285 views, 0 favs, 4 embeds more stats

    More info about this document

    CC Attribution License

    Go to text version

    • Total Views 285
      • 183 on SlideShare
      • 102 from embeds
    • Comments 0
    • Favorites 0
    • Downloads 5
    Most viewed embeds
    • 99 views on http://watirmelon.com
    • 1 views on http://rocketkeis.wordpress.com
    • 1 views on http://hexawise.wordpress.com
    • 1 views on http://watirmelon.wordpress.com

    more

    All embeds
    • 99 views on http://watirmelon.com
    • 1 views on http://rocketkeis.wordpress.com
    • 1 views on http://hexawise.wordpress.com
    • 1 views on http://watirmelon.wordpress.com

    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