Automatic system tests of web applications

815 views

Published on

Slides for the speech I gave for the .net developers group in Toruń, Poland.

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

  • Be the first to like this

No Downloads
Views
Total views
815
On SlideShare
0
From Embeds
0
Number of Embeds
4
Actions
Shares
0
Downloads
9
Comments
0
Likes
0
Embeds 0
No embeds

No notes for slide

Automatic system tests of web applications

  1. 1. Automatic System Testing with Watin, Selenium and Visual Studio Piotr Benetkiewicz, AIS.PL
  2. 2. Dictionary <ul><li>What is a: </li></ul><ul><ul><li>unit test </li></ul></ul><ul><ul><li>acceptance test </li></ul></ul><ul><ul><li>integration test </li></ul></ul><ul><ul><li>system test </li></ul></ul><ul><li>What system testing means: </li></ul><ul><ul><li>for a webservice? </li></ul></ul><ul><ul><li>for a webapp? </li></ul></ul>
  3. 3. Agenda <ul><ul><li>Quick introduction to: Selenium, Watin, VS 2010 Automated UI Tests </li></ul></ul><ul><ul><li>DEMO </li></ul></ul><ul><ul><li>Conclusions, bit of theory, encouragement, best practices, etc. </li></ul></ul>
  4. 4. Visual Studio 2010 Automatic UI Tests <ul><ul><li>Build in Premium and Ultimate editions </li></ul></ul><ul><ul><li>UI Tests in general - not only web apps </li></ul></ul><ul><ul><li>Good toolset </li></ul></ul><ul><ul><li>Tight TFS integration  </li></ul></ul>
  5. 5. Selenium <ul><li>Selenium automates browsers. That's it. What you do with that power is entirely up to you.   </li></ul><ul><li>Selenium suite: </li></ul><ul><ul><li>Selenium IDE </li></ul></ul><ul><ul><li>Selenium Server </li></ul></ul><ul><ul><li>Selenium Remote Control </li></ul></ul>
  6. 6. Selenium cont. <ul><li>1. Create scenario in Selenium IDE (Firefox) </li></ul><ul><li>2. Export to remote control </li></ul><ul><li>3. Run as Nunit unit test... </li></ul><ul><li>4. ...using Selenium Remote Control on  Selenium Server </li></ul>
  7. 7. Watin <ul><ul><li>Inspired by Watir (R stands for Ruby) </li></ul></ul><ul><ul><li>No toolkit - just the API (watin recorder sux ;-)) </li></ul></ul><ul><ul><li>Supports IE and FF </li></ul></ul><ul><ul><li>Good support from CodePlex community </li></ul></ul><ul><ul><li>http://www.watin.org </li></ul></ul>
  8. 8. Visual Studio Automated UI Testing <ul><ul><li>One of the Unit Test project types </li></ul></ul><ul><ul><li>Built-in recorder </li></ul></ul><ul><ul><li>Part of VS 2010 Premium and Ultimate </li></ul></ul><ul><ul><li>Deep integration with TFS features </li></ul></ul>
  9. 9. DEMO
  10. 10. Advantages <ul><ul><li>Very high code coverage </li></ul></ul><ul><ul><ul><li>You can have 100% coverage if you click through the entire flow... </li></ul></ul></ul><ul><ul><ul><li>...and you'll know it works, you just don't know if it works as it should... </li></ul></ul></ul><ul><ul><li>Unit test can build only a part of the confidence </li></ul></ul><ul><ul><ul><li>What about UI glitches </li></ul></ul></ul><ul><ul><ul><li>DB can fail too... </li></ul></ul></ul><ul><ul><li>Support when migrating, refactoring, optimizing. </li></ul></ul><ul><ul><li>Build your confidence in &quot;Live&quot; product changes </li></ul></ul>
  11. 11. Disadvantages <ul><ul><li>Require user session </li></ul></ul><ul><ul><li>Hard to maintain </li></ul></ul><ul><ul><li>Have &quot;moods&quot; </li></ul></ul><ul><ul><li>Require additional infrastructure </li></ul></ul><ul><ul><li>&quot;Don't compile&quot; </li></ul></ul><ul><ul><li>Require discipline - run always or save yourself the trouble  </li></ul></ul>
  12. 12. Good practices <ul><ul><li>Test the process, not its details </li></ul></ul><ul><ul><li>Find.ById vs. autogenerated IDs (web forms) </li></ul></ul><ul><ul><li>&quot;Compile&quot; what you can </li></ul></ul><ul><ul><ul><li>constants </li></ul></ul></ul><ul><ul><ul><li>helpers </li></ul></ul></ul><ul><ul><li>Run it frequently </li></ul></ul>
  13. 13. Other applications <ul><ul><li>Bug reports </li></ul></ul><ul><ul><li>BDD </li></ul></ul>
  14. 14. The End <ul><ul><li>Thank you! </li></ul></ul><ul><ul><li>[email_address] </li></ul></ul><ul><ul><li>Questions? </li></ul></ul>

×