Тестирование производительности Ajax приложений с помощью JMeter

4,717 views
4,689 views

Published on

Тестирование производительности Ajax приложений с помощью JMeter, Владимир Примаков
В этом докладе будет раскрыт вопрос автоматизации тестирования производительности Ajax приложений с помощью бесплатного инструмента jmeter. Я расскажу об основных особенностях и трудностях автоматизации производительности Ajax приложений, о том, с какими конкретно проблемами я сталкивался и как они решались. Также я приведу ряд полезных советов, которые, возможно, облегчат вашу жизнь, если Вы вдруг решитесь провести тестирование производительности ajax приложений.

0 Comments
1 Like
Statistics
Notes
  • Be the first to comment

No Downloads
Views
Total views
4,717
On SlideShare
0
From Embeds
0
Number of Embeds
2,368
Actions
Shares
0
Downloads
20
Comments
0
Likes
1
Embeds 0
No embeds

No notes for slide

Тестирование производительности Ajax приложений с помощью JMeter

  1. 1. Performance Testing AJAX Application with JMeter Vladimir Primakovatdays.com
  2. 2. Agenda AJAX Main Difficulties of Performance Testing of AJAX applications with jmeter and their Solutions Conclusions Questionsatdays.com #atdays 2
  3. 3. Me QA Manager at Kuadriga company. 3 years of continuous experience in automated testing: IBM Rational Robot, Test Complete, Selenium (RC), Jmeter. Successfully applied server-side performance and load testing on 4-5 different projects. Enjoy photography, sports, and self-improvement Profile in Linkedin: http://www.linkedin.com/in/vladimirprimakov Email: v.v.primakov@gmail.com Skype: vladimir.primakovatdays.com #atdays 3
  4. 4. AJAX – XMLHttpRequest + DHTML (HTML, CSS, Javascript) AJAX - ASYNCHRONOUS JAVASCRIPT AND XMLatdays.com #atdays 4
  5. 5. Classic and Ajax Web-appsatdays.com #atdays 5
  6. 6. Classic and Ajax Web-apps Classic Browser Client Server Side Web-server Data store, GUI backend processingatdays.com #atdays 6
  7. 7. Classic and Ajax Web-apps Classic Browser Client Server Side Http Request Web-server Data store, http(s) transport backend GUI processingatdays.com #atdays 7
  8. 8. Classic and Ajax Web-apps Classic Browser Client Server Side Http Request Web-server Data store, http(s) transport backend GUI Http Response processing HTML + javascript + CSS dataatdays.com #atdays 8
  9. 9. Classic and Ajax Web-apps Classic Browser Client Server Side Http Request Web-server Data store, http(s) transport backend GUI Http Response processing HTML + javascript + CSS data AJAX Browser Client Server Side Web/ Data store, XML/ backend GUI JSON processing serveratdays.com #atdays 9
  10. 10. Classic and Ajax Web-apps Classic Browser Client Server Side Http Request Web-server Data store, http(s) transport backend GUI Http Response processing HTML + javascript + CSS data AJAX Browser Client Server Side JavaScript Web/ Data store, call XML/ Ajax backend GUI JSON Engine processing serveratdays.com #atdays 10
  11. 11. Classic and Ajax Web-apps Classic Browser Client Server Side Http Request Web-server Data store, http(s) transport backend GUI Http Response processing HTML + javascript + CSS data AJAX Browser Client Server Side JavaScript Web/ Data store, call XML/ Ajax backend GUI JSON Engine processing XMLHttp Request server objectatdays.com #atdays 11
  12. 12. Classic and Ajax Web-apps Classic Browser Client Server Side Http Request Web-server Data store, http(s) transport backend GUI Http Response processing HTML + javascript + CSS data AJAX Browser Client Server Side JavaScript (XML)Http Request Web/ call Data store, Ajax http(s) transport XML/ backend GUI JSON Engine processing XMLHttp Request server objectatdays.com #atdays 12
  13. 13. Classic and Ajax Web-apps Classic Browser Client Server Side Http Request Web-server Data store, http(s) transport backend GUI Http Response processing HTML + javascript + CSS data AJAX Browser Client Server Side JavaScript (XML)Http Request Web/ call Data store, Ajax http(s) transport XML/ backend GUI JSON Engine (XML) Http Response processing XMLHttp Request server object XML/JSONatdays.com #atdays 13
  14. 14. Classic and Ajax Web-apps Classic Browser Client Server Side Http Request Web-server Data store, http(s) transport backend GUI Http Response processing HTML + javascript + CSS data AJAX Browser Client Server Side JavaScript (XML)Http Request Web/ call Data store, Ajax http(s) transport XML/ backend GUI HTML+CSS JSON Engine (XML) Http Response processing XMLHttp Request server object XML/JSONatdays.com #atdays 14
  15. 15. Classic and Ajax Web-apps Classic Browser Client Server Side Http Request Web-server Data store, http(s) transport backend GUI Http Response processing Size - Big AJAX Browser Client Server Side JavaScript (XML)Http Request Web/ call Data store, Ajax http(s) transport XML/ backend GUI HTML+CSS JSON Engine (XML) Http Response processing XMLHttp Request server object Size - Smallatdays.com #atdays 15
  16. 16. Classic Request Response Post HTML Pageatdays.com #atdays 16
  17. 17. Classic Request Response Post HTML Page Request AJAX JSON Response Post Part of a page a) b)atdays.com #atdays 17
  18. 18. (AJAX) JSON Response Part of a page a) b)atdays.com #atdays 18
  19. 19. Vaadin}> (GWT) Ajax frameworkatdays.com #atdays 19
  20. 20. Vaadin}> (GWT) Ajax framework Server Side Backend Processing Browser Client VaadinGWT widgets Server-side GUI GWT Web Java GUI Server (javascript) objects UIDL - User Interface Description Languageatdays.com #atdays 20
  21. 21. Vaadin}> (GWT) Ajax framework Server Side Backend Processing Browser Client VaadinGWT widgets Server-side GUI GWT Mirroring (GUI) Web Java GUI Server (javascript) objects UIDL - User Interface Description Languageatdays.com #atdays 21
  22. 22. Vaadin}> (GWT) Ajax framework Server Side Backend Processing Browser Client VaadinGWT widgets Server-side GUI GWT Web Java GUI Server (javascript) objects UIDL - User Interface Description Languageatdays.com #atdays 22
  23. 23. Vaadin}> (GWT) Ajax framework Server Side Backend Processing Browser Client VaadinGWT widgets UIDL Server-side GUI GWT Vaadin Web Java GUI Engine Server (javascript) objects (javascript) UIDL - User Interface Description Languageatdays.com #atdays 23
  24. 24. Vaadin}> (GWT) Ajax framework Server Side Backend Processing Browser Client JSON (UIDL) VaadinGWT widgets UIDL Server-side GUI GWT Vaadin Web Java GUI Engine Server (javascript) objects (javascript) UIDL - User Interface Description Languageatdays.com #atdays 24
  25. 25. Vaadin}> (GWT) Ajax framework Server Side Backend Processing Browser Client JSON (UIDL)GWT widgets (XML) Http Request Vaadin UIDL Server-side GUI GWT Vaadin http(s) transport Web Java GUI Engine Server (javascript) objects (javascript) UIDL - User Interface Description Languageatdays.com #atdays 25
  26. 26. Vaadin}> (GWT) Ajax framework Server Side Backend Processing Browser Client JSON (UIDL)GWT widgets (XML) Http Request Vaadin UIDL Server-side GUI GWT Vaadin http(s) transport Web Java GUI Engine Server UIDL (javascript) objects (javascript) UIDL - User Interface Description Languageatdays.com #atdays 26
  27. 27. Vaadin}> (GWT) Ajax framework Server Side Backend Processing Browser Client JSON (UIDL)GWT widgets (XML) Http Request Vaadin UIDL Server-side GUI GWT Vaadin http(s) transport Web Java GUI Engine Server UIDL (XML) Http Response objects (javascript) (javascript) JSON (UIDL) UIDL - User Interface Description Languageatdays.com #atdays 27
  28. 28. UIDL Request (Post) (Show Notifications window) (UIDL) JSON Response (Rendering Notifications window)atdays.com #atdays 28
  29. 29. UIDL Request (Post) (Show Notifications window) (UIDL) JSON Response (Rendering Notifications window)atdays.com #atdays 29
  30. 30. UIDL Request (Post) (Show Notifications window) (UIDL) JSON Response (Rendering Notifications window) Element Type Paintable ID Argumentsatdays.com #atdays 30
  31. 31. MAIN DIFFICULTIES OF PERFORMANCE TESTING OF AJAX APPLICATIONS WITH JMETER AND THEIR SOLUTIONSatdays.com #atdays 31
  32. 32. MAIN DIFFICULTIES OF PERFORMANCE TESTING OF AJAX APPLICATIONS WITH JMETER AND THEIR SOLUTIONSatdays.com #atdays 32
  33. 33. MAIN DIFFICULTIES OF PERFORMANCE TESTING OF AJAX APPLICATIONS WITH JMETER AND THEIR SOLUTIONSatdays.com #atdays 33
  34. 34. MAIN DIFFICULTIES OF PERFORMANCE TESTING OF AJAX APPLICATIONS WITH JMETER AND THEIR SOLUTIONSatdays.com #atdays 34
  35. 35. Typical Performance/Load Testing Stages Identify the Test Environment Identify Performance Acceptance Criteria Plan and Design Usage Scenarios Implement the Usage Scenarios (Scripts) Configure the Test Environment Execute the Test Analyze Results, Report, and Retestatdays.com #atdays 35
  36. 36. Typical Performance/Load Testing Stages Identify the Test Environment Identify Performance Acceptance Criteria Plan and Design Usage Scenarios Implement the Usage Scenarios (Scripts) Configure the Test Environment Execute the Test Analyze Results, Report, and Retestatdays.com #atdays 36
  37. 37. Problems in Details: Typical Ajax Applications Unreadable Responses/Requests Hard to find consistency between Responses/Requests and GUI elements Dynamic IDs Sequential dependency between requestsatdays.com #atdays 37
  38. 38. Problems in Details: Vaadin (UIDL) Ajax Applications The same URL for most requests(Vaadin) Dependency on Screen Resolution (Vaadin) Error requests are not evident (Vaadin) Too many requests (Vaadin)atdays.com #atdays 38
  39. 39. SOLUTIONSatdays.com #atdays 40
  40. 40. Unreadable Responses/Requestsatdays.com #atdays 41
  41. 41. Unreadable Responses/Requests 1. Get used to this formatatdays.com #atdays 42
  42. 42. 2. Use JSON Viewersatdays.com #atdays 43
  43. 43. 3. Use JSON Parsersatdays.com #atdays 44
  44. 44. 4. Parse JSON Yourselfatdays.com #atdays 45
  45. 45. Hard to find consistency between Responses/Requests and GUI elementsatdays.com #atdays 46
  46. 46. Hard to find consistency between Responses/Requests and GUI elements 1. Use self-explanatory named IDs (classes) for GUI elementsatdays.com #atdays 47
  47. 47. Hard to find consistency between Responses/Requests and GUI elements 1. Use self-explanatory named IDs (classes) for GUI elementsatdays.com #atdays 48
  48. 48. 2. Use Anchorsatdays.com #atdays 49
  49. 49. 2. Use Anchors SAMPLE Scenario: 1. Create a ticket via email in the task management system 2. Check that the ticket is created 3. Delete the ticketatdays.com #atdays 50
  50. 50. 1) Creating a ticket via email (SMTP Sampler) 2. Use Anchorsatdays.com #atdays 51
  51. 51. 1) Creating a ticket via email (SMTP Sampler) 2. Use Anchors 2) Login into the Ticket Systematdays.com #atdays 52
  52. 52. 1) Creating a ticket via email (SMTP Sampler) 2. Use Anchors 2) Login into the Ticket System3) Request to show tickets atdays.com #atdays 53
  53. 53. 1) Creating a ticket via email (SMTP Sampler) 2. Use Anchors 2) Login into the Ticket System3) Request to show tickets 4) JSON Response (Tickets page) atdays.com #atdays 54
  54. 54. 1) Creating a ticket via email (SMTP Sampler) 2. Use Anchors 2) Login into the Ticket System 5) Checking whether the ticket is created3) Request to show tickets 4) JSON Response (Tickets page) atdays.com #atdays 55
  55. 55. 1) Creating a ticket via email (SMTP Sampler) 2. Use Anchors 2) Login into the Ticket System 5) Checking whether the ticket is created3) Request to show tickets 4) JSON Response (Tickets page)6) Extracting ticket ID (Regular Expression Extractor) atdays.com #atdays 56
  56. 56. 1) Creating a ticket via email (SMTP Sampler) 2. Use Anchors 2) Login into the Ticket System 5) Checking whether the ticket is created3) Request to show tickets 4) JSON Response (Tickets page)6) Extracting ticket ID (Regular Expression Extractor) 7) Request to Delete ticket atdays.com #atdays 57
  57. 57. Dynamic IDsatdays.com #atdays 58
  58. 58. Dynamic IDs Put Your application into the mode with Static IDs (Don’t forget to restore this mode every time you run scripts)atdays.com #atdays 59
  59. 59. Dynamic IDs Put Your application into the mode with Static IDs (Don’t forget to restore this mode every time you run scripts) Set specific (debug) IDs for your GUI elements <h2 id=“AjaxPTproblems">atdays.com #atdays 60
  60. 60. Dynamic IDs Put Your application into the mode with Static IDs (Don’t forget to restore this mode every time you run scripts) Set specific (debug) IDs for your GUI elements <h2 id=“AjaxPTproblems"> Use anchorsatdays.com #atdays 61
  61. 61. Sequential dependency between requests E.g.: IDs of all If dynamic IDs are tree elements used, sequential changes every time I make dependency changes to between requests the tree happens - it means that previous actions may influence next actions and the order of actions mattersatdays.com #atdays 62
  62. 62. Sequential dependency between requests Define definite initial data in the tested applicationatdays.com #atdays 63
  63. 63. Sequential dependency between requests Define definite initial data in the tested application Breakdown scenarios into undependable chunksatdays.com #atdays 64
  64. 64. Sequential dependency between requests Define definite initial data in the tested application Breakdown scenarios into undependable chunks Record scenarios from the beginning to the end of the chunksatdays.com #atdays 65
  65. 65. Sequential dependency between requests Define definite initial data in the tested application Breakdown scenarios into undependable chunks Record scenarios from the beginning to the end of the chunks Separate chunks using login/logout (because initialization of IDs happens after login)atdays.com #atdays 66
  66. 66. Exampleatdays.com #atdays 68
  67. 67. The same URL for the most requests (Vaadin) Rename During Recording Rename requests during traffic recording - at once as a certain definite action is made by you in a web-browser.atdays.com #atdays 69
  68. 68. Dependency on Screen Resolution (Vaadin) Screen coordinates are used while accessing these buttons Define one screen resolution for your tests and record traffic only for itatdays.com #atdays 70
  69. 69. Error requests are not evident (Vaadin) The response code for Vaadin “Out of Sync” and other response Errors is still HTTP/1.1 200atdays.com #atdays 71
  70. 70. Put Global Response Assertion on the test plan levelatdays.com #atdays 72
  71. 71. Too many requests (Vaadin)atdays.com #atdays 73
  72. 72. Too many requests (Vaadin) Get used to it! atdays.com #atdays 74
  73. 73. Other Problems Difficulty to make estimations Script creation for (full) AJAX application takes ~ 3-4 times more than for Classic applicationatdays.com #atdays 75
  74. 74. Other Problems Difficulty to make estimations Script creation for (full) AJAX application takes ~ 3-4 times more than for Classic application Bad Supportability (Vaadin) If application changes in most cases you have to recreate the affected scenarios completely.atdays.com #atdays 76
  75. 75. Conclusionsatdays.com #atdays 77
  76. 76. Vladimir Primakov Email: v.v.primakov@gmail.com Skype: vladimir.primakovatdays.com #atdays 78

×