Browser-Based testing using Selenium

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

    3 Favorites

    Browser-Based testing using Selenium - Presentation Transcript

    1. Selenium Browser-Based-Testing for everyone
    2. The Part for the Consultants
    3. Who, Why? •All the cool kids (Google, local.ch, etc.) •Automatically test what the user ends up with
    4. Three States of a System
    5. The Bad The Unknown The Good
    6. Goal
    7. Goal Transform requirements to simple tests
    8. Goal Collect Tests that correspond with your use cases
    9. Goal Run these tests over and over
    10. Selenium IDE
    11. Selenium IDE Think
    12. Selenium IDE Think Record
    13. Selenium IDE Think Record Play
    14. Demo
    15. Next Steps •Download Selenium IDE •http://seleniumhq.org/ download/ •Test
    16. The Part for the Nerds
    17. Overview •Local Tests using IDE •Local Tests using RC •Test on Server using RC
    18. Server Windows Solaris OS X Linux Firefox 2 / 3 Opera 8 / 9 IE 7 / 8 Safari 2 / 3
    19. Server java -jar selenium- server.jar
    20. Client Libs •C#, Java, Perl, PHP, Python, Ruby browser = new DefaultSelenium(...) browser.open(‘http://localhost’)
    21. Testing Frameworks NUnit JUnit unittest Test::Unit TestNG RSpec the framework you wrote by yourself cause you were bored the other day
    22. Example (Java) public class GoogleTest extends TestCase { private Selenium browser; public void setUp() { browser = new DefaultSelenium(\"localhost\", 4444, \"*firefox\", \"http://www.google.com\"); browser.start(); } public void testGoogle() { browser.open(\"http://www.google.com/webhp?hl=en\"); browser.type(\"q\", \"hello world\"); browser.click(\"btnG\"); browser.waitForPageToLoad(\"5000\"); assertEquals(\"hello world - Google Search\", browser.getTitle()); } public void tearDown() { browser.stop(); } }
    23. Don’t use the default Xpaths. Seriously
    24. •Proper, meaningful div classes •correct IDs •//body/div[2]/div/div[1]...
    25. Integrate JS Tests •JS Framework (YUI, etc...) •Dedicated JS Testsite •Selenium checks Testsite browser.verifyTextPresent(‘Failed: 0’)
    26. Integrate Backend Verifications •Your language •Your testing Framework
    27. Integrate Backend Verifications •Your language •Your testing Framework Why wouldn’t you mix in some other tests?
    28. Integrate Backend Verifications browser.loginUser(‘mike’) backend.isUserAuthenticated(‘mike’)
    29. Browser-Based Tests are slow •Yes they are •Selenium Grid to the rescue
    30. It’s all messed up, popups, crazy JS and whatnot. There’s no way I can test that
    31. Start with simple things browser.open(...) browser.isTextPresent(...) browser.click(...)
    32. Conclusions •Clean stuff is testable (sounds familiar...)
    33. Conclusions •Proper markup is something not only your tests will benefit from •RESTful is pretty
    34. Sources / Further Reading • Official Website: • http://seleniumhq.org/ • Google Techtalks on Selenium • http://www.youtube.com/watch?v=EDb8yOM3Vpw • http://www.youtube.com/watch?v=k-03mDiEWEg
    35. Questions? • reto@techbase.ch • www.twitter.com/ret0
    36. Credits • Long Beach Harbor Patrol Say No Photography From a Public Sidewalk: http://www.flickr.com/photos/thomashawk/3147786573/ • Red, Yellow, Green http://www.flickr.com/photos/adampenney/2296489836/ • Student shown here. Arthur Morris leads an advanced Instructional Photo Tour class on Morro Strand State Beach 13 Jan. 2009 http://www.flickr.com/photos/mikebaird/3195053131/ • Lit Beach http://www.flickr.com/photos/jasongriset/475057715/

    + ret0ret0, 7 months ago

    custom

    970 views, 3 favs, 2 embeds more stats

    More info about this document

    © All Rights Reserved

    Go to text version

    • Total Views 970
      • 937 on SlideShare
      • 33 from embeds
    • Comments 0
    • Favorites 3
    • Downloads 50
    Most viewed embeds
    • 31 views on http://know.namics.com
    • 2 views on https://know.namics.com

    more

    All embeds
    • 31 views on http://know.namics.com
    • 2 views on https://know.namics.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