Your SlideShare is downloading. ×
0
Intro of Selenium
Objective <ul><li>Introduction to aspects of Selenium </li></ul><ul><li>Target audience: anyone who has interests in web-a...
Dilemmas <ul><li>UI changes </li></ul><ul><li>Platforms </li></ul><ul><li>Browsers </li></ul><ul><li>Development efforts <...
What is Selenium? <ul><li>Web-based App testing tool, running directly in browser. </li></ul><ul><li>Implemented entirely ...
What can do? <ul><li>Browsers-compatible testing – one script, many browsers </li></ul><ul><li>Acceptance testing </li></u...
Behind the scenes <ul><li>Deploy BrowserBot alongside AUT </li></ul><ul><li>Use JS and IFrame to embed BrowserBot </li></u...
Quick Demo <ul><li>Access google.com </li></ul><ul><li>Input keyword “selenium” </li></ul><ul><li>Verify a link </li></ul>
Script looks <ul><li>Html table </li></ul><table cellpadding=&quot;1&quot; cellspacing=&quot;1&quot; border=&quot;1&quot;>...
Script model selenium.openqa.org verifyTextPresent btnG clickAndWait selenium q type / open Value Target Command
Action <ul><li>open </li></ul><ul><li>type </li></ul><ul><li>click </li></ul><ul><li>select </li></ul><ul><li>clickAndWait...
VP <ul><li>verifyXXX </li></ul><ul><li>assertXXX </li></ul><ul><li>For ajax use: </li></ul><ul><ul><li>waitForXXX </li></u...
Locators <ul><li>Identify elements via locators: </li></ul><ul><ul><li>id=id </li></ul></ul><ul><ul><li>link=name </li></u...
String matching <ul><li>glob:pattern </li></ul><ul><ul><li>* </li></ul></ul><ul><ul><li>? </li></ul></ul><ul><li>regexp:pa...
Playback <ul><li>Run </li></ul><ul><li>Walk </li></ul><ul><li>Step </li></ul>
Test Suite <ul><li>Html table </li></ul><table> <tr> <td>Test Suite</td> </tr> <tr> <td><a target=&quot;testFrame&quot; hr...
Components <ul><li>Core </li></ul><ul><li>IDE </li></ul><ul><li>RC </li></ul><ul><li>Grid </li></ul>
Selenium Core <ul><li>Basis of Selenium IDE and RC </li></ul><ul><li>Runs test suites on the same server to avoid the Same...
Selenium IDE <ul><li>for quick recording of tests, but it somewhat lacks for power </li></ul>
Selenium RC <ul><li>Different langs binding </li></ul><ul><li>Gives the ability to drive Selenium from a real programming ...
Selenium Grid <ul><li>extends Selenium RC to distribute your tests across multiple servers, saving you time by running tes...
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...
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...
Tips <ul><li>Data-driven </li></ul><ul><li>Dynamic pages(php, jsp) </li></ul><ul><li>Record your script in S-IDE, then use...
Extension <ul><li>There are a lot of commands - you can even add your own custom commands into the user-extensions.js </li...
Problems encountered <ul><li>Bug </li></ul><ul><li>Tweak </li></ul><ul><li>Not support native dialog </li></ul>
Selenium vs. RFT <ul><li>Development </li></ul><ul><li>Deployment </li></ul><ul><li>Platform/browsers support </li></ul><u...
Where to get? <ul><li>http://selenium.openqa.org/ </li></ul>
Upcoming SlideShare
Loading in...5
×

Intro Of Selenium

2,689

Published on

Published in: Technology
0 Comments
1 Like
Statistics
Notes
  • Be the first to comment

No Downloads
Views
Total Views
2,689
On Slideshare
0
From Embeds
0
Number of Embeds
1
Actions
Shares
0
Downloads
128
Comments
0
Likes
1
Embeds 0
No embeds

No notes for slide

Transcript of "Intro Of Selenium"

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

    Clipping is a handy way to collect important slides you want to go back to later.

×