KEMBAR78
Intro Of Selenium | PPT
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/

Intro Of Selenium

  • 1.
  • 2.
    Objective Introduction toaspects of Selenium Target audience: anyone who has interests in web-app automation
  • 3.
    Dilemmas UI changesPlatforms 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 scenesDeploy 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 Accessgoogle.com Input keyword “selenium” Verify a link
  • 8.
    Script looks Htmltable <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.orgverifyTextPresent btnG clickAndWait selenium q type / open Value Target Command
  • 10.
    Action open typeclick select clickAndWait
  • 11.
    VP verifyXXX assertXXXFor ajax use: waitForXXX waitForCondition
  • 12.
    Locators Identify elementsvia 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.
  • 15.
    Test Suite Htmltable <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.
  • 17.
    Selenium Core Basisof 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 forquick recording of tests, but it somewhat lacks for power
  • 19.
    Selenium RC Differentlangs binding Gives the ability to drive Selenium from a real programming language (Java, Perl, Python, Ruby, and more)
  • 20.
    Selenium Grid extendsSelenium RC to distribute your tests across multiple servers, saving you time by running tests in parallel.
  • 21.
    Browsers support PartialN/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 YY 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 Dynamicpages(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 area lot of commands - you can even add your own custom commands into the user-extensions.js
  • 25.
    Problems encountered BugTweak Not support native dialog
  • 26.
    Selenium vs. RFTDevelopment Deployment Platform/browsers support Maintainance Scope Use right tool case by case
  • 27.
    Where to get?http://selenium.openqa.org/