SlideShare a Scribd company logo
Ajax Load Testing ConsiderationsLoad Testing Ajax Websites
Background	Eric Beland Co-Founder, Testomatixhttp://testomatix.comebeland@testomatix.comTwitter: @testomatix	Testomatix provides full service performance testing including expert planning, scripting, and test execution. We test for you, and help you tune.
Testing Ajax Websites
Will it Scale?What happens when people show up?
Testing at the HTTP Layer
Testing at the HTTP LayerAdvantage: Scalable - No browserSmall memory and CPU footprint  Tools:  HP LoadRunner, Jmeter, Grinder, Oracle e-LoadCreated by: Recording from within the browser—browser plugins or hooks.Intercepting requests with a proxy tool. May be hand-scripted.
Challenges At the HTTP layerThings that aren’t as smooth when simulating the browser…
Hard-Coded URLs
Hard-coded URLsIf a request is dependent on a previous Ajax request which, after a certain number of users starts failing, a real user would fail.  If you have a hard-coded the URL, your test will pass when it shouldn’t.If an Ajax request is vital to the user interaction,Content-checked (match against text in the HTML)Or defined as a RegExp source for navigation
Ajax Load Testing Concerns By Eric Beland
Recording Issues – Is it recording?Does your tool record AJAX traffic?VS 2005 doesn't record Ajax calls.Proxy-based tools tend to do well when recording Ajax.Some proxy based recorders can’t record https traffic. Jmeter, for example
Things that won’t work, at least easilyHighly JavaScript-dependent code.Any client-server interaction that is dependent on complex client-side computationUnless you re-implement the logic in your testing tool…Client-side decompressionClient side JS encryption (Don’t do this. Really.)ObfuscationStreaming
Recording Issues – Ajax + REST IssuesREST (Representational State Transfer) makes use of 4 HTTP verbs GET, POST, PUT and DELETEBrowsers do not have support for PUT and DELETE currently (HTML 5) But it IS supported in the XMLHttpRequest implementation in all major browsers.But, your load testing tool may not be able to record it, or replay it.Currently (Sept. 09) the case in Oracle e-Load.  Used to be an issue in JMeter.Likely still an issue in other tools.
Script MaintenanceScript recording	Unless you remember, or your testers determine every place Ajax has been added or removed from a script, you need to recreate your scripts for them to be accurate.A “real life” example:http://thedailywtf.com/Articles/Slowing-Time.aspx
Statefulness ConsiderationAjax requests may require a session cookie, or value in a cookie.If the cookie is not configured to be updated, the request will fail.
Client-side JS Timestamp on CacheTimestamps may be hard coded in your recorded postsWe have seen JavaScript caching, with timestamps which need to be updated.
Validate Ajax ReturnsFor valid testing, the return values of AJAX calls must be validated.  If they are not validated, the script may appear to work past the number of users which the application can support.
AutoComplete FieldsThink time between Ajax requests—users type quickly.In order to replicate real load, and exercise any caching effectively, requests must be parameterized.AutoComplete fields send requests key-by-key. Parameterization may not account for this properly.
Ajax Load Testing Concerns By Eric Beland
Ajax AutocompleteAutocomplete made these requests:Parameterization is tricky.
The correct way to generate the load is to make multiple requests for the parameter.
Additionally, it looks like cp=could be a character count. http://clients1.google.com/complete/search?hl=en&client=hp&q=a&cp=1http://clients1.google.com/complete/search?hl=en&client=hp&q=aja&cp=3http://clients1.google.com/complete/search?hl=en&client=hp&q=ajax&cp=4
AJAX Polling or AJAX StreamingJavaScript which does AJAX polling in the background. Polling interval may change, which changes the load associated with a page.Comet (Streaming)When added or removed, load scripts must be updated.
ReportingMany tools work on the “page” model for load testing.  Ajax apps do not necessarily follow the page model, and in many cases, the application is not “working” when the AJAX functionality is not working.Ajax timeouts must be treated as full-fledged failures.
AJAX Response TimesAJAX response time expectationsNot the same as page load response expectationsAjax response times should follow UI response time rules, which have their own laws, and generally need to be faster.A 6 second page load might be ok, but a 6 second lag between UI responses is painfulUI Responsiveness rules are pretty brutal when applied to web applications.
TimeoutsChoosing timeoutsLoad/Scalability testsLower timeouts are appropriate for Ajax heavy applications.Determine how many users you can support within acceptable-response times.10 seconds is probably a reasonable threshold for an Ajax request.
AJAX/UI response time rules Excerpt from Jacob Nielsen's Usability Engineering"The basic advice regarding response times has been about the same for almost thirty years [Miller 1968; Card et al. 1991]: 0.1 second is about the limit for having the user feel that the system is reacting instantaneously, meaning that no special feedback is necessary except to display the result. 1.0 second is about the limit for the user's flow of thought to stay uninterrupted, even though the user will notice the delay. Normally, no special feedback is necessary during delays of more than 0.1 but less than 1.0 second, but the user does lose the feeling of operating directly on the data. 10 seconds is about the limit for keeping the user's attention focused on the dialogue. For longer delays, users will want to perform other tasks while waiting for the computer to finish, so they should be given feedback indicating when the computer expects to be done. Feedback during the delay is especially important if the response time is likely to be highly variable, since users will then not know what to expect."
New Alternatives to HTTP Layer TestingBrowser-based load testing.Historically, not very scalable.Enter the cloudThe cloud makes browser based load testing scalable. LoadStorm
BenefitsScript maintainabilityChanges to the websites AJAX code will flow through as JavaScript is executed at test-time.Proper handling of: Changes to Polling intervalsNew AJAX requestsDeleted AJAX requestsAuto-complete fields

More Related Content

PDF
Neoload
PPTX
Eric Beland Ajax Load Testing Considerations
PPT
Neoload overview
PPTX
Load Testing using Continuous Integration tools
PPTX
Dave Orchard - Offline Web Apps with HTML5
PPT
Ajax Testing Approach
PPT
Ajax Testing Approach
PPT
Dyna trace
Neoload
Eric Beland Ajax Load Testing Considerations
Neoload overview
Load Testing using Continuous Integration tools
Dave Orchard - Offline Web Apps with HTML5
Ajax Testing Approach
Ajax Testing Approach
Dyna trace

What's hot (20)

PPTX
Using Automation to Meet Demands for Performance and Quality
PPTX
Mountebank and you
PPT
Web performance testing
PPT
ASP.NET AJAX with Visual Studio 2008
PDF
Performance testing automation with Dynatrace @LDNWebPerf - AndreasGrabner
PPTX
Slideshare - Magento Imagine - Do You Queue
PDF
Effectively Monitoring Client-Side Performance
DOCX
Load testing with vs 2013
PPT
Ajax & ASP.NET 2
PPTX
Lightning page optimization & best practices
PPTX
Load testing with Visual Studio and Azure - Andrew Siemer
PPTX
10 practices that every developer needs to start right now
PPTX
From Zero to Performance Hero in Minutes - Agile Testing Days 2014 Potsdam
PDF
Client-side Web Performance Optimization [paper]
PPTX
Systematic Load Testing of Web Applications
PPTX
Client side performance analysis
PPTX
Sydney Continuous Delivery Meetup May 2014
PPT
Performance Testing With Loadrunner
PPTX
Performance Metrics for your Build Pipeline - presented at Vienna WebPerf Oct...
PDF
Visual studio performance testing quick reference guide 3 6
Using Automation to Meet Demands for Performance and Quality
Mountebank and you
Web performance testing
ASP.NET AJAX with Visual Studio 2008
Performance testing automation with Dynatrace @LDNWebPerf - AndreasGrabner
Slideshare - Magento Imagine - Do You Queue
Effectively Monitoring Client-Side Performance
Load testing with vs 2013
Ajax & ASP.NET 2
Lightning page optimization & best practices
Load testing with Visual Studio and Azure - Andrew Siemer
10 practices that every developer needs to start right now
From Zero to Performance Hero in Minutes - Agile Testing Days 2014 Potsdam
Client-side Web Performance Optimization [paper]
Systematic Load Testing of Web Applications
Client side performance analysis
Sydney Continuous Delivery Meetup May 2014
Performance Testing With Loadrunner
Performance Metrics for your Build Pipeline - presented at Vienna WebPerf Oct...
Visual studio performance testing quick reference guide 3 6
Ad

Viewers also liked (15)

PPT
Situation Analysis Deck - Social Media Listening & Monitoring Lanscape
PDF
Calculo i [u de chile]
PDF
Aprenda linux
PPT
Selección de definición y otros insumos
PPTX
Chemical Bonding In Sports ♥
PPTX
Evolucion hisorica de los computadores grado 10
PPTX
Ergonomics and Environmental Friendly Laptop
PPTX
Communication conflict interdisciplinary_team
PDF
Recursos y servicios de información de las comunidades científicas: Los repo...
PPT
Session04 pt
PPT
Clase macromoleculas
PDF
Confeccionvestidoindustriatextil tec
PPT
3º Workshop de Aprendizagem e Desenvolvimento - Palestra de Tiago Tamborini.
PDF
Masterthesis Bewonersparticipatie In De Netwerksamenleving En De Meerwaarde V...
Situation Analysis Deck - Social Media Listening & Monitoring Lanscape
Calculo i [u de chile]
Aprenda linux
Selección de definición y otros insumos
Chemical Bonding In Sports ♥
Evolucion hisorica de los computadores grado 10
Ergonomics and Environmental Friendly Laptop
Communication conflict interdisciplinary_team
Recursos y servicios de información de las comunidades científicas: Los repo...
Session04 pt
Clase macromoleculas
Confeccionvestidoindustriatextil tec
3º Workshop de Aprendizagem e Desenvolvimento - Palestra de Tiago Tamborini.
Masterthesis Bewonersparticipatie In De Netwerksamenleving En De Meerwaarde V...
Ad

Similar to Ajax Load Testing Concerns By Eric Beland (20)

PDF
A model for performance testing of ajax based web applications
PPT
Ajax and PHP
PDF
PAC 2019 virtual Arjan Van Den Berg
PPTX
TGT#19 - 3 seconds or less - Piotr Liss
PDF
A novel approach for evaluation of applying ajax in the web site
PPT
PPT
Performance testing jmeter
PPS
Sohamsg ajax
PPT
Performance testing and j meter
PPT
AJAX Crawl
PPTX
Introduction to ajax
PPT
Using Ajax In Domino Web Applications
PDF
Gatling - Bordeaux JUG
PDF
Performancetestingjmeter 121109061704-phpapp02
PDF
Research Inventy : International Journal of Engineering and Science
PPT
Lecture 10 Answers
DOCX
Perf test Eng interview preparation
PPT
jQuery Ajax
A model for performance testing of ajax based web applications
Ajax and PHP
PAC 2019 virtual Arjan Van Den Berg
TGT#19 - 3 seconds or less - Piotr Liss
A novel approach for evaluation of applying ajax in the web site
Performance testing jmeter
Sohamsg ajax
Performance testing and j meter
AJAX Crawl
Introduction to ajax
Using Ajax In Domino Web Applications
Gatling - Bordeaux JUG
Performancetestingjmeter 121109061704-phpapp02
Research Inventy : International Journal of Engineering and Science
Lecture 10 Answers
Perf test Eng interview preparation
jQuery Ajax

Recently uploaded (20)

PDF
Jake Seal Top 5 Career Milestones in the Film Industry.pdf
PPTX
Ethical_Clothing_Presentation for everyone
PPTX
GEE2-BEED-II: Ibaloi Indigenous People .pptx
PDF
Student Housing Security From Metal Keys to Smart Access.pdf
PDF
5 Popular Designs of Kashmir Silk Handmade Carpets.pdf
PDF
PrayerPetals- Empowering Women Through Faith-Based Support.pdf
PPTX
Term review 2023 Hirata TYPHOON.pptx review
PPTX
Expert Custom Tailoring Services for All Needs.pptx
DOC
学历学位硕士ACAP毕业证,澳大利亚凯斯林大学毕业证留学未毕业
PDF
Maslow's Hierarchy Isn't a Ladder — It's a Loop (by Meenakshi Khakat)
PDF
Echoes of Tomorrow - A Sustainable Legacy for Future Generations.pdf
PPTX
Benefits of Red Cyan Glasses - rdoptical.com.pptx
PDF
4 Mindset Shifts to Turn Frustration into Focus
PPTX
James 1 Bible verses sermonbbbbbbbbbb.pptx
PDF
8 Effective Mosquito Control Tips for Gardens in the Monsoon Season
PPTX
CLASS9 CLIMATE PPT MY VERSION ( FOR ONLINE CLASS [Autosaved].pptx
PPTX
Hyperlipidemia current medication with lifestyle.
DOCX
Free Pomodoro Tecnique Effect Guide -25mint - pomodorotimer.com.au
PDF
Economic and Financial Abuse - Hidden Tools of Power in Domestic Violence
PDF
Pranotsava Monsoon Retreat - Fazlani Nature's Nest
Jake Seal Top 5 Career Milestones in the Film Industry.pdf
Ethical_Clothing_Presentation for everyone
GEE2-BEED-II: Ibaloi Indigenous People .pptx
Student Housing Security From Metal Keys to Smart Access.pdf
5 Popular Designs of Kashmir Silk Handmade Carpets.pdf
PrayerPetals- Empowering Women Through Faith-Based Support.pdf
Term review 2023 Hirata TYPHOON.pptx review
Expert Custom Tailoring Services for All Needs.pptx
学历学位硕士ACAP毕业证,澳大利亚凯斯林大学毕业证留学未毕业
Maslow's Hierarchy Isn't a Ladder — It's a Loop (by Meenakshi Khakat)
Echoes of Tomorrow - A Sustainable Legacy for Future Generations.pdf
Benefits of Red Cyan Glasses - rdoptical.com.pptx
4 Mindset Shifts to Turn Frustration into Focus
James 1 Bible verses sermonbbbbbbbbbb.pptx
8 Effective Mosquito Control Tips for Gardens in the Monsoon Season
CLASS9 CLIMATE PPT MY VERSION ( FOR ONLINE CLASS [Autosaved].pptx
Hyperlipidemia current medication with lifestyle.
Free Pomodoro Tecnique Effect Guide -25mint - pomodorotimer.com.au
Economic and Financial Abuse - Hidden Tools of Power in Domestic Violence
Pranotsava Monsoon Retreat - Fazlani Nature's Nest

Ajax Load Testing Concerns By Eric Beland

  • 1. Ajax Load Testing ConsiderationsLoad Testing Ajax Websites
  • 2. Background Eric Beland Co-Founder, Testomatixhttp://testomatix.comebeland@testomatix.comTwitter: @testomatix Testomatix provides full service performance testing including expert planning, scripting, and test execution. We test for you, and help you tune.
  • 4. Will it Scale?What happens when people show up?
  • 5. Testing at the HTTP Layer
  • 6. Testing at the HTTP LayerAdvantage: Scalable - No browserSmall memory and CPU footprint Tools: HP LoadRunner, Jmeter, Grinder, Oracle e-LoadCreated by: Recording from within the browser—browser plugins or hooks.Intercepting requests with a proxy tool. May be hand-scripted.
  • 7. Challenges At the HTTP layerThings that aren’t as smooth when simulating the browser…
  • 9. Hard-coded URLsIf a request is dependent on a previous Ajax request which, after a certain number of users starts failing, a real user would fail. If you have a hard-coded the URL, your test will pass when it shouldn’t.If an Ajax request is vital to the user interaction,Content-checked (match against text in the HTML)Or defined as a RegExp source for navigation
  • 11. Recording Issues – Is it recording?Does your tool record AJAX traffic?VS 2005 doesn't record Ajax calls.Proxy-based tools tend to do well when recording Ajax.Some proxy based recorders can’t record https traffic. Jmeter, for example
  • 12. Things that won’t work, at least easilyHighly JavaScript-dependent code.Any client-server interaction that is dependent on complex client-side computationUnless you re-implement the logic in your testing tool…Client-side decompressionClient side JS encryption (Don’t do this. Really.)ObfuscationStreaming
  • 13. Recording Issues – Ajax + REST IssuesREST (Representational State Transfer) makes use of 4 HTTP verbs GET, POST, PUT and DELETEBrowsers do not have support for PUT and DELETE currently (HTML 5) But it IS supported in the XMLHttpRequest implementation in all major browsers.But, your load testing tool may not be able to record it, or replay it.Currently (Sept. 09) the case in Oracle e-Load. Used to be an issue in JMeter.Likely still an issue in other tools.
  • 14. Script MaintenanceScript recording Unless you remember, or your testers determine every place Ajax has been added or removed from a script, you need to recreate your scripts for them to be accurate.A “real life” example:http://thedailywtf.com/Articles/Slowing-Time.aspx
  • 15. Statefulness ConsiderationAjax requests may require a session cookie, or value in a cookie.If the cookie is not configured to be updated, the request will fail.
  • 16. Client-side JS Timestamp on CacheTimestamps may be hard coded in your recorded postsWe have seen JavaScript caching, with timestamps which need to be updated.
  • 17. Validate Ajax ReturnsFor valid testing, the return values of AJAX calls must be validated. If they are not validated, the script may appear to work past the number of users which the application can support.
  • 18. AutoComplete FieldsThink time between Ajax requests—users type quickly.In order to replicate real load, and exercise any caching effectively, requests must be parameterized.AutoComplete fields send requests key-by-key. Parameterization may not account for this properly.
  • 20. Ajax AutocompleteAutocomplete made these requests:Parameterization is tricky.
  • 21. The correct way to generate the load is to make multiple requests for the parameter.
  • 22. Additionally, it looks like cp=could be a character count. http://clients1.google.com/complete/search?hl=en&client=hp&q=a&cp=1http://clients1.google.com/complete/search?hl=en&client=hp&q=aja&cp=3http://clients1.google.com/complete/search?hl=en&client=hp&q=ajax&cp=4
  • 23. AJAX Polling or AJAX StreamingJavaScript which does AJAX polling in the background. Polling interval may change, which changes the load associated with a page.Comet (Streaming)When added or removed, load scripts must be updated.
  • 24. ReportingMany tools work on the “page” model for load testing. Ajax apps do not necessarily follow the page model, and in many cases, the application is not “working” when the AJAX functionality is not working.Ajax timeouts must be treated as full-fledged failures.
  • 25. AJAX Response TimesAJAX response time expectationsNot the same as page load response expectationsAjax response times should follow UI response time rules, which have their own laws, and generally need to be faster.A 6 second page load might be ok, but a 6 second lag between UI responses is painfulUI Responsiveness rules are pretty brutal when applied to web applications.
  • 26. TimeoutsChoosing timeoutsLoad/Scalability testsLower timeouts are appropriate for Ajax heavy applications.Determine how many users you can support within acceptable-response times.10 seconds is probably a reasonable threshold for an Ajax request.
  • 27. AJAX/UI response time rules Excerpt from Jacob Nielsen's Usability Engineering"The basic advice regarding response times has been about the same for almost thirty years [Miller 1968; Card et al. 1991]: 0.1 second is about the limit for having the user feel that the system is reacting instantaneously, meaning that no special feedback is necessary except to display the result. 1.0 second is about the limit for the user's flow of thought to stay uninterrupted, even though the user will notice the delay. Normally, no special feedback is necessary during delays of more than 0.1 but less than 1.0 second, but the user does lose the feeling of operating directly on the data. 10 seconds is about the limit for keeping the user's attention focused on the dialogue. For longer delays, users will want to perform other tasks while waiting for the computer to finish, so they should be given feedback indicating when the computer expects to be done. Feedback during the delay is especially important if the response time is likely to be highly variable, since users will then not know what to expect."
  • 28. New Alternatives to HTTP Layer TestingBrowser-based load testing.Historically, not very scalable.Enter the cloudThe cloud makes browser based load testing scalable. LoadStorm
  • 29. BenefitsScript maintainabilityChanges to the websites AJAX code will flow through as JavaScript is executed at test-time.Proper handling of: Changes to Polling intervalsNew AJAX requestsDeleted AJAX requestsAuto-complete fields
  • 30. When to use browser-based testingWhen you have an Ajax heavy or dynamic siteWhen you have flash or difficult-to-reproduce interactions.When your man-hours are preciousEasier maintenance and development make it worthwhileGenerally affordable for small tests, run frequentlyWhen you can!
  • 31. When not to used browser-based testingWhen you need to test 200,000 users.Cost prohibitiveWhen you cannot expose your site to external traffic (intranet)There are commercial load testing tools that let you run real browsers locally. For smaller tests, this can work.

Editor's Notes

  • #10: Need photo
  • #12: Mention firebug…
  • #13: Via Ajax
  • #19: Should say “send request” instead of type
  • #21: Requests in two places
  • #22: Heartbeat slide should be next to this
  • #28: Remove extra bullet