Intro Of Selenium

  • 2,652 views
Uploaded on

 

More in: Technology
  • Full Name Full Name Comment goes here.
    Are you sure you want to
    Your message goes here
    Be the first to comment
No Downloads

Views

Total Views
2,652
On Slideshare
0
From Embeds
0
Number of Embeds
1

Actions

Shares
Downloads
128
Comments
0
Likes
1

Embeds 0

No embeds

Report content

Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
    No notes for slide

Transcript

  • 1. Intro of Selenium
  • 2. Objective
    • Introduction to aspects of Selenium
    • Target audience: anyone who has interests in web-app automation
  • 3. Dilemmas
    • UI changes
    • Platforms
    • Browsers
    • Development efforts
    • Maintainance efforts
  • 4. What is Selenium?
    • Web-based App testing tool, running directly in browser.
    • Implemented entirely with browser techs
      • DHTML
      • JavaScript
      • Frames
    • Works by inspecting DOM
  • 5. What can do?
    • Browsers-compatible testing – one script, many browsers
    • Acceptance testing
    • Regression testing
  • 6. Behind the scenes
    • Deploy BrowserBot alongside AUT
    • Use JS and IFrame to embed BrowserBot
    • Engine is tweaked to support wide range of browsers on different OS
  • 7. Quick Demo
    • Access google.com
    • Input keyword “selenium”
    • Verify a link
  • 8. Script looks
    • Html table
    <table cellpadding=&quot;1&quot; cellspacing=&quot;1&quot; border=&quot;1&quot;> <tr> <td> open </td><td> / </td><td></td> </tr> <tr> <td> type </td><td> q </td><td> selenium </td> </tr> <tr> <td> clickAndWait </td><td> btnG </td><td></td> </tr> <tr> <td> verifyTextPresent </td><td> selenium.openqa.org </td><td></td> </tr> </table>
  • 9. Script model selenium.openqa.org verifyTextPresent btnG clickAndWait selenium q type / open Value Target Command
  • 10. Action
    • open
    • type
    • click
    • select
    • clickAndWait
  • 11. VP
    • verifyXXX
    • assertXXX
    • For ajax use:
      • waitForXXX
      • waitForCondition
  • 12. Locators
    • Identify elements via locators:
      • id=id
      • link=name
      • dom=document.select[2]
      • xpath=//input[@name=‘btn’]
      • css=a[href=‘#id2’]
  • 13. String matching
    • glob:pattern
      • *
      • ?
    • regexp:pattern
    • exact:string
  • 14. Playback
    • Run
    • Walk
    • Step
  • 15. Test Suite
    • Html table
    <table> <tr> <td>Test Suite</td> </tr> <tr> <td><a target=&quot;testFrame&quot; href=“google.html&quot;>test Google</a></td> </tr> </table>
  • 16. Components
    • Core
    • IDE
    • RC
    • Grid
  • 17. Selenium Core
    • Basis of Selenium IDE and RC
    • Runs test suites on the same server to avoid the Same Origin problem
    • Don’t have same flexibility as RC, but tests and code under test is in the same spot
  • 18. Selenium IDE
    • for quick recording of tests, but it somewhat lacks for power
  • 19. Selenium RC
    • Different langs binding
    • Gives the ability to drive Selenium from a real programming language (Java, Perl, Python, Ruby, and more)
  • 20. Selenium Grid
    • extends Selenium RC to distribute your tests across multiple servers, saving you time by running tests in parallel.
  • 21. Browsers support Partial N/A Others Y Y N/A Opera 8 Y Y N/A Opera 9 Y Y N/A Safari 2 Y Y N/A Safari 3 Y Y N/A IE 7 ? ? N/A IE 8b1 Y Y Y FF 2 Y Y Y FF 3 Core RC IDE Browser
  • 22. OS Support Y Y works on FF 2+ Others Y Y works on FF 2+ Solaris Y Y works on FF 2+ Linux Y Y works on FF 2+ OS X Y Y works on FF 2+ Windows Core RC IDE OS
  • 23. Tips
    • Data-driven
    • Dynamic pages(php, jsp)
    • Record your script in S-IDE, then use it as a base for a S-RC script
    • Use Firebug to give you the XPath
  • 24. Extension
    • There are a lot of commands - you can even add your own custom commands into the user-extensions.js
  • 25. Problems encountered
    • Bug
    • Tweak
    • Not support native dialog
  • 26. Selenium vs. RFT
    • Development
    • Deployment
    • Platform/browsers support
    • Maintainance
    • Scope
    • Use right tool case by case
  • 27. Where to get?
    • http://selenium.openqa.org/