Intro Of Selenium
Upcoming SlideShare
Loading in...5
×
 

Intro Of Selenium

on

  • 3,880 views

 

Statistics

Views

Total Views
3,880
Views on SlideShare
3,861
Embed Views
19

Actions

Likes
1
Downloads
127
Comments
0

3 Embeds 19

http://www.slideshare.net 14
https://www.linkedin.com 3
http://www.linkedin.com 2

Accessibility

Categories

Upload Details

Uploaded via as Microsoft PowerPoint

Usage Rights

© All Rights Reserved

Report content

Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
  • Full Name Full Name Comment goes here.
    Are you sure you want to
    Your message goes here
    Processing…
Post Comment
Edit your comment

Intro Of Selenium Intro Of Selenium Presentation Transcript

  • Intro of Selenium
  • Objective
    • Introduction to aspects of Selenium
    • Target audience: anyone who has interests in web-app automation
  • Dilemmas
    • UI changes
    • Platforms
    • Browsers
    • Development efforts
    • Maintainance efforts
  • What is Selenium?
    • Web-based App testing tool, running directly in browser.
    • Implemented entirely with browser techs
      • DHTML
      • JavaScript
      • Frames
    • Works by inspecting DOM
  • What can do?
    • Browsers-compatible testing – one script, many browsers
    • Acceptance testing
    • Regression testing
  • 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
  • Quick Demo
    • Access google.com
    • Input keyword “selenium”
    • Verify a link
  • 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>
  • Script model selenium.openqa.org verifyTextPresent btnG clickAndWait selenium q type / open Value Target Command
  • Action
    • open
    • type
    • click
    • select
    • clickAndWait
  • VP
    • verifyXXX
    • assertXXX
    • For ajax use:
      • waitForXXX
      • waitForCondition
  • Locators
    • Identify elements via locators:
      • id=id
      • link=name
      • dom=document.select[2]
      • xpath=//input[@name=‘btn’]
      • css=a[href=‘#id2’]
  • String matching
    • glob:pattern
      • *
      • ?
    • regexp:pattern
    • exact:string
  • Playback
    • Run
    • Walk
    • Step
  • 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>
  • Components
    • Core
    • IDE
    • RC
    • Grid
  • 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
  • Selenium IDE
    • for quick recording of tests, but it somewhat lacks for power
  • Selenium RC
    • Different langs binding
    • Gives the ability to drive Selenium from a real programming language (Java, Perl, Python, Ruby, and more)
  • Selenium Grid
    • extends Selenium RC to distribute your tests across multiple servers, saving you time by running tests in parallel.
  • 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
  • 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
  • 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
  • Extension
    • There are a lot of commands - you can even add your own custom commands into the user-extensions.js
  • Problems encountered
    • Bug
    • Tweak
    • Not support native dialog
  • Selenium vs. RFT
    • Development
    • Deployment
    • Platform/browsers support
    • Maintainance
    • Scope
    • Use right tool case by case
  • Where to get?
    • http://selenium.openqa.org/