Sakai10 Selenium Workshop

913 views

Published on

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

  • Be the first to like this

No Downloads
Views
Total views
913
On SlideShare
0
From Embeds
0
Number of Embeds
2
Actions
Shares
0
Downloads
19
Comments
0
Likes
0
Embeds 0
No embeds

No notes for slide

Sakai10 Selenium Workshop

  1. 1. Selenium Workshop Corey McGarrahan QA Lead rSmart
  2. 2. Questions, Slides and Links <ul><ul><li>Please feel free to ask questions at any time </li></ul></ul><ul><ul><li>Slides will be available at: http://www.slideshare.net </li></ul></ul><ul><ul><li>http://confluence.sakaiproject.org/display/QA/Selenium </li></ul></ul><ul><ul><li>http://confluence.sakaiproject.org/display/QA/Selenium+Remote+Control+and+TestNG </li></ul></ul>11th Sakai Conference - June 15-17, 2010
  3. 3. <ul><ul><li>Tools needed </li></ul></ul><ul><ul><ul><li>Add-ons </li></ul></ul></ul><ul><ul><li>Using Seleium IDE </li></ul></ul><ul><ul><ul><li>Recording </li></ul></ul></ul><ul><ul><ul><li>Playback </li></ul></ul></ul><ul><ul><ul><li>Test Suites </li></ul></ul></ul><ul><ul><li>Selenium/TestNG Project </li></ul></ul><ul><ul><ul><li>Setup </li></ul></ul></ul><ul><ul><ul><li>Use </li></ul></ul></ul>What We’ll Cover 11th Sakai Conference - June 15-17, 2010
  4. 4. A cautionary tail… 11th Sakai Conference - June 15-17, 2010
  5. 5. Selenium IDE
  6. 6. Additional Add-ons…
  7. 7. Open up the IDE
  8. 8. IDE Controls
  9. 9. Record a Test
  10. 10. Steps... <ul><ul><ul><li>Navigate to webpage </li></ul></ul></ul><ul><ul><ul><li>Start Recording </li></ul></ul></ul><ul><ul><ul><li>Execute Test Procedure </li></ul></ul></ul><ul><ul><ul><li>Stop Recording </li></ul></ul></ul><ul><ul><ul><li>Edit (if needed) </li></ul></ul></ul>
  11. 11. XPath Selenium IDE will give you options for the 'target' value.
  12. 12. XPath Using the Firebug Inspect function will give you additional options for the 'target' value.
  13. 13. Manual XPath <ul><li>Any element that has an attribute (The first matching element will be selected): </li></ul><ul><li>// input [@ value =' submit '] </li></ul><ul><li><input type= &quot;image&quot; src= &quot;/library/skin/rsmart/images/loginButton.gif&quot; value= &quot;submit&quot; /> </li></ul><ul><ul><li>An  input  with a value of  submit . </li></ul></ul><ul><li>Any element that 'contains' an attribute with specific text: </li></ul><ul><li>// a [ contains (@ href ,' resources.doc& ')] </li></ul><ul><li><a title= &quot;Attach a copy&quot; href= &quot;localhost:8080/resources.doc&sakai_action=doAttachitem&quot; >Attach a copy</a> </li></ul><ul><ul><li>An  a  element that contains an href attribute with the text  resources.doc&  anywhere in it. </li></ul></ul><ul><ul><ul><li>In this case the  title  attribute could not be used because there was more than one element on the page with the title value of  Attach a copy . </li></ul></ul></ul>
  14. 14. Test Suite
  15. 15. Test Suite Selenium IDE allows for creation of Test Suites right in the IDE.
  16. 16. Test Suite Example
  17. 17. Selenium RC and TestNG
  18. 18. Sakai Test Suite <ul><li>Selenium Remote Control </li></ul><ul><li>Selenium Remote Control (RC) is a test tool that allows you to write automated web application UI tests in any programming language against any HTTP website using any mainstream JavaScript-enabled browser. Selenium RC comes in two parts. </li></ul><ul><ul><li>A server which automatically launches and kills browsers, and acts as a HTTP proxy for web requests from them. </li></ul></ul><ul><ul><li>Client libraries for your favorite computer language. </li></ul></ul><ul><li>  </li></ul><ul><li>TestNG </li></ul><ul><li>TestNG is a testing framework inspired from JUnit and NUnit but introducing some new functionality that make it more powerful and easier to use, such as: </li></ul><ul><ul><li>JDK 5 Annotations (JDK 1.4 is also supported with JavaDoc annotations). </li></ul></ul><ul><ul><li>Flexible test configuration. </li></ul></ul><ul><ul><li>Support for data-driven testing (with @DataProvider). </li></ul></ul><ul><ul><li>Support for parameters. </li></ul></ul><ul><ul><li>Allows distribution of tests on slave machines. </li></ul></ul><ul><ul><li>Powerful execution model (no more TestSuite). </li></ul></ul><ul><ul><li>Supported by a variety of tools and plug-ins (Eclipse, IDEA, Maven, etc...). </li></ul></ul><ul><ul><li>Embeds BeanShell for further flexibility. </li></ul></ul><ul><ul><li>Default JDK functions for runtime and logging (no dependencies). </li></ul></ul><ul><ul><li>Dependent methods for application server testing. </li></ul></ul><ul><li>TestNG is designed to cover all categories of tests: unit, functional, end-to-end, integration, etc.. </li></ul>
  19. 19. Sakai Test Suite Kick off test_suite from the command line with two commands: ant launch-remote-control ant -Dsuite=sakai-suite-setup-27.xml
  20. 20. Links <ul><ul><li>Selenium and Xpath </li></ul></ul><ul><ul><ul><li>http://confluence.sakaiproject.org/display/QA/Selenium </li></ul></ul></ul><ul><ul><li>Selenium and TestNG </li></ul></ul><ul><ul><ul><li>http://confluence.sakaiproject.org/display/QA/Selenium+Remote+Control+and+TestNG </li></ul></ul></ul><ul><ul><li>Sakai Test Suite </li></ul></ul><ul><ul><ul><li>https://source.sakaiproject.org/contrib/qa/trunk/functional </li></ul></ul></ul>

×