Testing Ajax Applications when to test, what to test, how to test Ajax applications Square One University Series
<ul><li>For the latest version of this presentation,  visit  http://slideshare.com/ted.husted </li></ul><ul><li>For the la...
Abstract <ul><li>Not long ago, testing Ajax meant play-testing by hand.  </li></ul><ul><li>Today, tools can simplify and a...
Testing Ajax Applications <ul><li>Ajax 101 </li></ul><ul><ul><li>How Ajax works </li></ul></ul><ul><ul><li>Why it complica...
Testing Ajax Applications <ul><li>Ajax 101 </li></ul><ul><ul><li>How Ajax works </li></ul></ul><ul><ul><li>Why it complica...
Testing Ajax Applications <ul><li>Ajax 101 </li></ul><ul><ul><li>How Ajax works </li></ul></ul><ul><ul><li>Why it complica...
Ajax 101 <ul><li>Marketing term coined in 2005  </li></ul><ul><li>Set of technologies </li></ul>
Ajax 101 <ul><li>Marketing term coined in 2005  </li></ul><ul><li>Set of technologies </li></ul><ul><li>In use since 1999 ...
Ajax 101 <ul><li>Marketing term coined in 2005  </li></ul><ul><li>Set of technologies </li></ul><ul><li>In use since 1999 ...
http://www.adaptivepath.com/ideas/essays/archives/000385.php
http://msexchangeteam.com/archive/2005/06/21/406646.aspx “ It was [the] desire to look,   act and feel like Outlook   that...
 
 
http://www.mailsite.com/Products/express-pro-ajax-web-email-calendar-client.asp
http://-x-web-email-calenda-  http://www.slideshare.net/satyajeet_02/web-20-5316/
http://www.mailsite.com/Products/express-pro-ajax-web-email-calendar-client.asp
Open QA Selenium <ul><li>Selenium is a suite of tools </li></ul>http://selenium.openqa.org/documentation/
Open QA Selenium <ul><li>Selenium is a suite of tools </li></ul><ul><li>Selenium IDE   </li></ul><ul><ul><li>records and r...
Open QA Selenium <ul><li>Selenium is a suite of tools </li></ul><ul><li>Selenium IDE   </li></ul><ul><ul><li>records and r...
Open QA Selenium <ul><li>Selenium is a suite of tools </li></ul><ul><li>Selenium IDE   </li></ul><ul><ul><li>records and r...
 
 
 
 
 
 
 
 
 
 
 
 
 
 
<tr><td> open </td><td >Welcome.action </td><td></td></tr> <tr><td> assertTitle </td><td> MailReader </td><td></td></tr> <...
 
 
RegisterTrillianTest.java public class RegisterTrillianTest extends SeleneseTestCase { public void testRegisterTrillian() ...
Selenium – Key Features <ul><li>Create test scripts using Selenium Commands. </li></ul>
Selenium – Key Features <ul><li>Create test scripts using Selenium Commands. </li></ul><ul><li>Run tests in against live a...
Selenium – Key Features <ul><li>Create test scripts using Selenium Commands. </li></ul><ul><li>Run tests in against live a...
Selenium – Key Features <ul><li>Create test scripts using Selenium Commands. </li></ul><ul><li>Run tests in against live a...
Selenium – Key Features <ul><li>Create test scripts using Selenium Commands. </li></ul><ul><li>Run tests in against live a...
Selenium – Key Features <ul><li>Support for major browsers </li></ul><ul><ul><li>Firefox 2+, (RC and Core) IE7, Safari 2+,...
http://clearspace.openqa.org/index.jspa
OpenQA Selenium <ul><li>Form Support </li></ul><ul><li>Asynchronous Support </li></ul><ul><li>Server Support </li></ul><ul...
Firefox 3 and Selenium RC <ul><li>The current Remote Control beta release (2007) is not compatible with FF3 </li></ul><ul>...
OpenQA Selenium <ul><li>Strengths    </li></ul><ul><ul><li>Granual toolset </li></ul></ul><ul><ul><li>Large, dedicated tea...
OpenQA Selenium <ul><li>Bottom Line </li></ul><ul><ul><li>Use to create acceptance tests </li></ul></ul><ul><ul><li>Comple...
Hudson <ul><li>Continuous build process framework </li></ul><ul><li>Runs as a Java  web application </li></ul><ul><li>BYO ...
 
 
https://hudson.dev.java.net/
http://cruisecontrol.sourceforge.net/dashboard.html
 
Hudson – Key Features <ul><li>RSS/E-mail/IM Integration </li></ul><ul><li>JUnit/TestNG test reporting </li></ul><ul><li>Pe...
Hudson – Key Features <ul><li>Quick Install, Free style setup  – Runs standalone, instant project checkout, automatic buil...
Hudson – Key Features <ul><li>Regular releases  (daily/weekly milestones) </li></ul><ul><li>License -- MIT / Creative Comm...
Hudson <ul><li>Strengths    </li></ul><ul><ul><li>Simple setup </li></ul></ul><ul><ul><li>Slick UI </li></ul></ul><ul><ul>...
http://cruisecontrol.sourceforge.net/overview.html
Let's Code It!
Ajax Testing Tool Review <ul><li>During the session, we covered </li></ul><ul><ul><li>when, what, and how to test Ajax app...
Square One University Series
Upcoming SlideShare
Loading in …5
×

Testing Ajax Web Applications

36,243 views

Published on

Not long ago, testing web applications with Ajax components meant play-testing a page by hand. Today, there are a growing number of tools we can use to simplify and automate Ajax testing.

In this session we will cover when to test, what to test and how to test web applications with Ajax components. You learn how to create automatic tests with tools like OpenQA Selenium, and how to use Ajax testing tools with continuous integration systems, like
CruiseControl or Hudson.

In this session, you will learn:

* How Ajax works, and why it complicates testing;
* When, where and how to test Ajax components;
* How to use Ajax testing tools with continuous integration systems.

Published in: Technology
2 Comments
2 Likes
Statistics
Notes
No Downloads
Views
Total views
36,243
On SlideShare
0
From Embeds
0
Number of Embeds
14,799
Actions
Shares
0
Downloads
448
Comments
2
Likes
2
Embeds 0
No embeds

No notes for slide

Testing Ajax Web Applications

  1. 1. Testing Ajax Applications when to test, what to test, how to test Ajax applications Square One University Series
  2. 2. <ul><li>For the latest version of this presentation, visit http://slideshare.com/ted.husted </li></ul><ul><li>For the latest version of source code, visit http://code.google.com/p/yazaar/ </li></ul><ul><li>For followup questions, write [email_address] </li></ul>Testing Ajax Applications
  3. 3. Abstract <ul><li>Not long ago, testing Ajax meant play-testing by hand. </li></ul><ul><li>Today, tools can simplify and automate Ajax testing. </li></ul><ul><li>In this session, we explore: </li></ul><ul><li>How Ajax works, and why it complicates testing; </li></ul><ul><li>When, where, and how to test Ajax components; </li></ul><ul><li>How to test with continuous integration systems. </li></ul>
  4. 4. Testing Ajax Applications <ul><li>Ajax 101 </li></ul><ul><ul><li>How Ajax works </li></ul></ul><ul><ul><li>Why it complicate testing </li></ul></ul>
  5. 5. Testing Ajax Applications <ul><li>Ajax 101 </li></ul><ul><ul><li>How Ajax works </li></ul></ul><ul><ul><li>Why it complicate testing </li></ul></ul><ul><li>Tool Review </li></ul><ul><ul><li>Selenium IDE and Remote Control </li></ul></ul><ul><ul><li>Hudson Continuous Integration Server </li></ul></ul>
  6. 6. Testing Ajax Applications <ul><li>Ajax 101 </li></ul><ul><ul><li>How Ajax works </li></ul></ul><ul><ul><li>Why it complicate testing </li></ul></ul><ul><li>Tool Review </li></ul><ul><ul><li>Selenium IDE and Remote Control </li></ul></ul><ul><ul><li>Hudson Continuous Integration Server </li></ul></ul><ul><li>Ajax Testing in Action </li></ul><ul><ul><li>Live Coding Demonstration </li></ul></ul><ul><ul><ul><li>Eclipse + Selenium + Subversion + Hudson </li></ul></ul></ul>
  7. 7. Ajax 101 <ul><li>Marketing term coined in 2005 </li></ul><ul><li>Set of technologies </li></ul>
  8. 8. Ajax 101 <ul><li>Marketing term coined in 2005 </li></ul><ul><li>Set of technologies </li></ul><ul><li>In use since 1999 (even 1996) </li></ul>
  9. 9. Ajax 101 <ul><li>Marketing term coined in 2005 </li></ul><ul><li>Set of technologies </li></ul><ul><li>In use since 1999 (even 1996) </li></ul><ul><li>An acronym made the difference </li></ul>Would you buy a pre-owned technology from this man?
  10. 10. http://www.adaptivepath.com/ideas/essays/archives/000385.php
  11. 11. http://msexchangeteam.com/archive/2005/06/21/406646.aspx “ It was [the] desire to look, act and feel like Outlook that caused us to move web applications forward in a new evolutionary path.”
  12. 14. http://www.mailsite.com/Products/express-pro-ajax-web-email-calendar-client.asp
  13. 15. http://-x-web-email-calenda- http://www.slideshare.net/satyajeet_02/web-20-5316/
  14. 16. http://www.mailsite.com/Products/express-pro-ajax-web-email-calendar-client.asp
  15. 17. Open QA Selenium <ul><li>Selenium is a suite of tools </li></ul>http://selenium.openqa.org/documentation/
  16. 18. Open QA Selenium <ul><li>Selenium is a suite of tools </li></ul><ul><li>Selenium IDE </li></ul><ul><ul><li>records and runs tests </li></ul></ul>http://selenium.openqa.org/documentation/
  17. 19. Open QA Selenium <ul><li>Selenium is a suite of tools </li></ul><ul><li>Selenium IDE </li></ul><ul><ul><li>records and runs tests </li></ul></ul><ul><li>Selenium Remote Control </li></ul><ul><ul><li>runs across multiple platforms </li></ul></ul>http://selenium.openqa.org/documentation /
  18. 20. Open QA Selenium <ul><li>Selenium is a suite of tools </li></ul><ul><li>Selenium IDE </li></ul><ul><ul><li>records and runs tests </li></ul></ul><ul><li>Selenium Remote Control </li></ul><ul><ul><li>runs across multiple platforms </li></ul></ul><ul><li>Selenium Grid </li></ul><ul><ul><li>runs across multiple machines </li></ul></ul>http://selenium.openqa.org/documentation/
  19. 35. <tr><td> open </td><td >Welcome.action </td><td></td></tr> <tr><td> assertTitle </td><td> MailReader </td><td></td></tr> <tr><td> clickAndWait </td><td> link=Register with MailReader </td><td></td> <tr><td> assertTitle </td><td> MailReader - Register </td><td></td></tr> <tr><td> type </td><td> Register_save_username </td><td> trillian </td></tr> <tr><td> type </td><td> Register_save_password </td><td> astra </td></tr> <tr><td> type </td><td> Register_save_password2 </td><td> astra </td></tr> <tr><td> type </td><td> Register_save_fullName </td><td> Tricia McMillian< /t <tr><td> type </td><td> Register_save_fromAddress </td><td> [email_address] <tr><td> clickAndWait </td><td> Register_save_Save </td><td></td></tr> <tr><td> assertTitle </td><td> MailReader - Menu </td><td></td></tr> <tr><td> assertTextPresent </td><td> Tricia McMillian </td><td></td></tr>
  20. 38. RegisterTrillianTest.java public class RegisterTrillianTest extends SeleneseTestCase { public void testRegisterTrillian() throws Exception { selenium.open(&quot; /menu/Welcome.action &quot;); assertEquals(&quot; MailReader &quot;, selenium.getTitle()); selenium.click(&quot; link=Register with MailReader &quot;); selenium.waitForPageToLoad(&quot; 30000 &quot;); assertEquals(&quot; MailReader - Register &quot;, selenium.getTitle()); selenium.type(&quot; Register_save_username &quot;, &quot; trillian &quot;); selenium.type(&quot; Register_save_password &quot;, &quot; astra &quot;); selenium.type(&quot; Register_save_password2 &quot;, &quot; astra &quot;); selenium.type(&quot; Register_save_fullName &quot;, &quot; Tricia McMillian &quot;); selenium.type(&quot; Register_save_fromAddress &quot;, &quot; [email_address] &quot;); selenium.click(&quot; Register_save_Save &quot;); selenium.waitForPageToLoad(&quot; 30000 &quot;); assertEquals(&quot; MailReader - Menu &quot;, selenium.getTitle()); checkForVerificationErrors(); }
  21. 39. Selenium – Key Features <ul><li>Create test scripts using Selenium Commands. </li></ul>
  22. 40. Selenium – Key Features <ul><li>Create test scripts using Selenium Commands. </li></ul><ul><li>Run tests in against live applications. </li></ul>
  23. 41. Selenium – Key Features <ul><li>Create test scripts using Selenium Commands. </li></ul><ul><li>Run tests in against live applications. </li></ul><ul><li>Compile test scripts in native languages, such as Java, C#, Ruby. </li></ul>
  24. 42. Selenium – Key Features <ul><li>Create test scripts using Selenium Commands. </li></ul><ul><li>Run tests in against live applications. </li></ul><ul><li>Compile test scripts in native languages, such as Java, C#, Ruby. </li></ul><ul><li>Integrate scripts with other test suites and continuous integrations systems. </li></ul>
  25. 43. Selenium – Key Features <ul><li>Create test scripts using Selenium Commands. </li></ul><ul><li>Run tests in against live applications. </li></ul><ul><li>Compile test scripts in native languages, such as Java, C#, Ruby. </li></ul><ul><li>Integrate scripts with other test suites and continuous integrations systems. </li></ul>
  26. 44. Selenium – Key Features <ul><li>Support for major browsers </li></ul><ul><ul><li>Firefox 2+, (RC and Core) IE7, Safari 2+, Opera 8+, Windows, OS X, Linus, Solaris. </li></ul></ul><ul><li>Current Releases </li></ul><ul><ul><li>IDE, RC, Grid, 2008; Core: 2007 </li></ul></ul><ul><ul><li>Since 2005 </li></ul></ul><ul><li>License – Apache </li></ul><ul><li>~11 Team Members </li></ul><ul><ul><li>ThoughtWorks project </li></ul></ul>
  27. 45. http://clearspace.openqa.org/index.jspa
  28. 46. OpenQA Selenium <ul><li>Form Support </li></ul><ul><li>Asynchronous Support </li></ul><ul><li>Server Support </li></ul><ul><li>IDE Support </li></ul><ul><li>CI Support </li></ul>
  29. 47. Firefox 3 and Selenium RC <ul><li>The current Remote Control beta release (2007) is not compatible with FF3 </li></ul><ul><li>Minor configuration issue with version numbering in FF3 </li></ul><ul><li>Hot patch available </li></ul><ul><li>Best Advice: Install FF2 in default location, and FF3 in an alternate spot. </li></ul>
  30. 48. OpenQA Selenium <ul><li>Strengths </li></ul><ul><ul><li>Granual toolset </li></ul></ul><ul><ul><li>Large, dedicated team </li></ul></ul><ul><ul><li>Steady releases </li></ul></ul><ul><ul><li>Active community </li></ul></ul><ul><li>Weaknesses </li></ul><ul><ul><li>Complex setup </li></ul></ul><ul><ul><li>Superficial suites </li></ul></ul><ul><ul><li>Choppy docs </li></ul></ul><ul><ul><li>Perpetual beta </li></ul></ul>
  31. 49. OpenQA Selenium <ul><li>Bottom Line </li></ul><ul><ul><li>Use to create acceptance tests </li></ul></ul><ul><ul><li>Complements unit tests </li></ul></ul><ul><ul><ul><li>jsUnit, YUI Test, qUnit </li></ul></ul></ul>
  32. 50. Hudson <ul><li>Continuous build process framework </li></ul><ul><li>Runs as a Java web application </li></ul><ul><li>BYO Container or standalone mode </li></ul>https://hudson.dev.java.net/
  33. 53. https://hudson.dev.java.net/
  34. 54. http://cruisecontrol.sourceforge.net/dashboard.html
  35. 56. Hudson – Key Features <ul><li>RSS/E-mail/IM Integration </li></ul><ul><li>JUnit/TestNG test reporting </li></ul><ul><li>Permanent links </li></ul><ul><li>Change set support </li></ul><ul><li>After-the-fact tagging </li></ul><ul><li>History trend, Distributed builds, File fingerprinting, Plugins. </li></ul>
  36. 57. Hudson – Key Features <ul><li>Quick Install, Free style setup – Runs standalone, instant project checkout, automatic build configuration. </li></ul><ul><li>Visual Configuration – No XML required. </li></ul><ul><li>Friendly Dashboard - Project status at a glance. </li></ul>
  37. 58. Hudson – Key Features <ul><li>Regular releases (daily/weekly milestones) </li></ul><ul><li>License -- MIT / Creative Community </li></ul>
  38. 59. Hudson <ul><li>Strengths </li></ul><ul><ul><li>Simple setup </li></ul></ul><ul><ul><li>Slick UI </li></ul></ul><ul><ul><li>Well documented </li></ul></ul><ul><ul><li>Regular releases </li></ul></ul><ul><ul><li>Active community </li></ul></ul><ul><li>Weaknesses </li></ul><ul><ul><li>Java container </li></ul></ul><ul><ul><li>Committers? </li></ul></ul>
  39. 60. http://cruisecontrol.sourceforge.net/overview.html
  40. 61. Let's Code It!
  41. 62. Ajax Testing Tool Review <ul><li>During the session, we covered </li></ul><ul><ul><li>when, what, and how to test Ajax applications </li></ul></ul><ul><ul><li>creating automatic tests with various tools </li></ul></ul><ul><ul><li>testing with IDEs and continuous Integration systems </li></ul></ul>
  42. 63. Square One University Series

×