SlideShare a Scribd company logo
Performance Testing
        AJAX Application with
                JMeter
             Vladimir Primakov




atdays.com
Agenda
     AJAX
     Main Difficulties of Performance Testing
     of AJAX applications with jmeter and
     their Solutions
     Conclusions
     Questions



atdays.com            #atdays                   2
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.primakov

atdays.com                       #atdays                                 3
AJAX – XMLHttpRequest + DHTML (HTML, CSS, Javascript)


    AJAX -        ASYNCHRONOUS JAVASCRIPT AND XML




atdays.com                     #atdays                         4
Classic and Ajax Web-apps




atdays.com      #atdays          5
Classic and Ajax Web-apps
         Classic
      Browser Client                            Server Side




                                   Web-server
                                                Data store,
                   GUI                          backend
                                                processing




atdays.com               #atdays                              6
Classic and Ajax Web-apps
         Classic
      Browser Client                                      Server Side
                         Http Request




                                             Web-server
                                                          Data store,
                         http(s) transport                backend
                   GUI
                                                          processing




atdays.com                    #atdays                                   7
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




atdays.com                     #atdays                                    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 data
             AJAX
      Browser Client                                          Server Side
                                                Web/           Data store,
                                                XML/           backend
    GUI                                         JSON           processing
                                                server


atdays.com                      #atdays                                      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
          JavaScript                                  Web/           Data store,
             call                                     XML/
                        Ajax                                         backend
    GUI                                               JSON
                       Engine                                        processing
                                                      server


atdays.com                            #atdays                                      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
                       XMLHttp
                       Request
                                                       server
                        object



atdays.com                             #atdays                                      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             (XML)Http Request     Web/
             call
                                                                      Data store,
                        Ajax      http(s) transport    XML/           backend
    GUI                                                JSON
                       Engine                                         processing
                       XMLHttp
                       Request
                                                       server
                        object



atdays.com                             #atdays                                      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    (XML) Http Response                  processing
                       XMLHttp
                       Request
                                                       server
                        object       XML/JSON

atdays.com                             #atdays                                      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 HTML+CSS                                    JSON
                    Engine    (XML) Http Response                  processing
                    XMLHttp
                    Request
                                                    server
                     object       XML/JSON

atdays.com                          #atdays                                      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

                                 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 - Small
atdays.com                          #atdays                                      15
Classic
             Request                 Response
               Post                  HTML Page




atdays.com                 #atdays               16
Classic
             Request                      Response
               Post                       HTML Page




             Request
                        AJAX             JSON Response
               Post                       Part of a page
                          a)
                          b)




atdays.com                     #atdays                     17
(AJAX) JSON Response
                Part of a page

        a)


        b)




atdays.com          #atdays         18
Vaadin}> (GWT) Ajax framework




atdays.com     #atdays            19
Vaadin}> (GWT) Ajax framework

                                                          Server Side
                                                                  Backend
                                                                 Processing

        Browser Client
                                                                    Vaadin
GWT widgets
                                                                Server-side GUI
    GWT                                             Web
                                                                      Java
    GUI                                             Server
  (javascript)
                                                                     objects




                   UIDL - User Interface Description Language

atdays.com                           #atdays                                      20
Vaadin}> (GWT) Ajax framework

                                                          Server Side
                                                                  Backend
                                                                 Processing

        Browser Client
                                                                    Vaadin
GWT widgets
                                                                Server-side GUI
    GWT                         Mirroring (GUI)     Web
                                                                      Java
    GUI                                             Server
  (javascript)
                                                                     objects




                   UIDL - User Interface Description Language

atdays.com                           #atdays                                      21
Vaadin}> (GWT) Ajax framework

                                                          Server Side
                                                                  Backend
                                                                 Processing

        Browser Client
                                                                    Vaadin
GWT widgets
                                                                Server-side GUI
    GWT                                             Web
                                                                      Java
    GUI                                             Server
  (javascript)
                                                                     objects




                   UIDL - User Interface Description Language

atdays.com                           #atdays                                      22
Vaadin}> (GWT) Ajax framework

                                                           Server Side
                                                                   Backend
                                                                  Processing

        Browser Client
                                                                     Vaadin
GWT widgets      UIDL                                            Server-side GUI
    GWT          Vaadin                              Web
                                                                       Java
    GUI          Engine                              Server
  (javascript)
                                                                      objects
                 (javascript)




                    UIDL - User Interface Description Language

atdays.com                            #atdays                                      23
Vaadin}> (GWT) Ajax framework

                                                           Server Side
                                                                   Backend
                                                                  Processing

        Browser Client          JSON (UIDL)
                                                                     Vaadin
GWT widgets      UIDL                                            Server-side GUI
    GWT          Vaadin                              Web
                                                                       Java
    GUI          Engine                              Server
  (javascript)
                                                                      objects
                 (javascript)




                    UIDL - User Interface Description Language

atdays.com                            #atdays                                      24
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 Language

atdays.com                               #atdays                                   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      UIDL
  (javascript)
                                                                        objects
                 (javascript)




                    UIDL - User Interface Description Language

atdays.com                               #atdays                                     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
                                (XML) Http Response                     objects
  (javascript)   (javascript)
                                    JSON (UIDL)




                    UIDL - User Interface Description Language

atdays.com                               #atdays                                     27
UIDL Request (Post)
               (Show Notifications window)




                 (UIDL) JSON Response
             (Rendering Notifications window)




atdays.com              #atdays                 28
UIDL Request (Post)
               (Show Notifications window)




                 (UIDL) JSON Response
             (Rendering Notifications window)




atdays.com              #atdays                 29
UIDL Request (Post)
               (Show Notifications window)




                 (UIDL) JSON Response
             (Rendering Notifications window)

                                                Element Type
                                                      Paintable ID


                                                      Arguments




atdays.com              #atdays                                   30
MAIN DIFFICULTIES OF PERFORMANCE
         TESTING OF AJAX APPLICATIONS WITH
             JMETER AND THEIR SOLUTIONS

atdays.com              #atdays              31
MAIN DIFFICULTIES OF PERFORMANCE
         TESTING OF AJAX APPLICATIONS WITH
             JMETER AND THEIR SOLUTIONS

atdays.com              #atdays              32
MAIN DIFFICULTIES OF PERFORMANCE
         TESTING OF AJAX APPLICATIONS WITH
             JMETER AND THEIR SOLUTIONS

atdays.com              #atdays              33
MAIN DIFFICULTIES OF PERFORMANCE
         TESTING OF AJAX APPLICATIONS WITH
             JMETER AND THEIR SOLUTIONS

atdays.com              #atdays              34
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 Retest

atdays.com                    #atdays                   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 Retest

atdays.com                    #atdays                   36
Problems in Details:
             Typical Ajax Applications

     Unreadable Responses/Requests
     Hard to find consistency between
     Responses/Requests and GUI elements
     Dynamic IDs
     Sequential dependency between requests




atdays.com             #atdays                37
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
SOLUTIONS




atdays.com      #atdays   40
Unreadable
             Responses/Requests




atdays.com          #atdays       41
Unreadable
             Responses/Requests

                         1. Get used to this
                         format




atdays.com          #atdays                    42
2. Use JSON Viewers




atdays.com         #atdays         43
3. Use JSON Parsers




atdays.com         #atdays         44
4. Parse JSON Yourself




atdays.com           #atdays          45
Hard to find consistency between
 Responses/Requests and GUI elements




atdays.com       #atdays               46
Hard to find consistency between
 Responses/Requests and GUI elements

             1. Use self-explanatory named IDs
             (classes) for GUI elements




atdays.com                  #atdays              47
Hard to find consistency between
 Responses/Requests and GUI elements

             1. Use self-explanatory named IDs
             (classes) for GUI elements




atdays.com                  #atdays              48
2. Use Anchors




atdays.com   #atdays                    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 ticket




atdays.com                #atdays                        50
1) Creating a ticket via email (SMTP Sampler)   2. Use Anchors




atdays.com                             #atdays                        51
1) Creating a ticket via email (SMTP Sampler)      2. Use Anchors
                                                     2) Login into the Ticket System




atdays.com                             #atdays                                         52
1) Creating a ticket via email (SMTP Sampler)      2. Use Anchors
                                                       2) Login into the Ticket System

3) Request to show tickets




 atdays.com                              #atdays                                         53
1) Creating a ticket via email (SMTP Sampler)      2. Use Anchors
                                                      2) Login into the Ticket System

3) Request to show tickets 4) JSON Response (Tickets page)




 atdays.com                             #atdays                                         54
1) Creating a ticket via email (SMTP Sampler)     2. Use Anchors
                                                      2) Login into the Ticket System
                                                                5) Checking whether the
                                                                   ticket is created
3) Request to show tickets 4) JSON Response (Tickets page)




 atdays.com                             #atdays                                        55
1) Creating a ticket via email (SMTP Sampler)        2. Use Anchors
                                                         2) Login into the Ticket System
                                                                   5) Checking whether the
                                                                      ticket is created
3) Request to show tickets 4) JSON Response (Tickets page)




6) Extracting ticket ID (Regular Expression Extractor)




 atdays.com                                #atdays                                        56
1) Creating a ticket via email (SMTP Sampler)        2. Use Anchors
                                                         2) Login into the Ticket System
                                                                   5) Checking whether the
                                                                      ticket is created
3) 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
Dynamic IDs




atdays.com       #atdays   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
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
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 anchors




atdays.com                    #atdays                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 matters


atdays.com             #atdays                       62
Sequential dependency between
             requests
     Define definite initial data in the tested
     application




atdays.com                #atdays                 63
Sequential dependency between
             requests
     Define definite initial data in the tested
     application
     Breakdown scenarios into undependable
     chunks




atdays.com               #atdays                  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 chunks




atdays.com               #atdays                  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
Example




atdays.com   #atdays   68
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
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 it




atdays.com                            #atdays                            70
Error requests are not evident
                (Vaadin)

               The response code for Vaadin
                  “Out of Sync” and other
             response Errors is still HTTP/1.1 200




atdays.com                   #atdays                 71
Put Global Response Assertion on the test plan level




atdays.com                        #atdays                           72
Too many requests (Vaadin)




atdays.com        #atdays           73
Too many requests (Vaadin)


                            Get used to it!
                            




atdays.com        #atdays                     74
Other Problems
     Difficulty to make estimations
      Script creation for (full) AJAX application takes ~
      3-4 times more than for Classic application




atdays.com                   #atdays                        75
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
Conclusions




atdays.com       #atdays   77
Vladimir
             Primakov
             Email:
             v.v.primakov@gmail.com
             Skype:
             vladimir.primakov

atdays.com               #atdays      78

More Related Content

PDF
Amish Umesh - Future Of Web App Testing - ClubHack2007
PDF
JAX 2012: Moderne Architektur mit Spring und JavaScript
PDF
X Aware Ajax World V1
PDF
Tripit Ajaxworld V5
PDF
Frank Mantek Google G Data
PDF
Web 2 0 Data Visualization With Jsf
PDF
Gregor Hohpe Track Intro The Cloud As Middle Ware
DOC
Gubendran Lakshmanan
Amish Umesh - Future Of Web App Testing - ClubHack2007
JAX 2012: Moderne Architektur mit Spring und JavaScript
X Aware Ajax World V1
Tripit Ajaxworld V5
Frank Mantek Google G Data
Web 2 0 Data Visualization With Jsf
Gregor Hohpe Track Intro The Cloud As Middle Ware
Gubendran Lakshmanan

What's hot (6)

PDF
Dave Carroll Application Services Salesforce
PDF
Developing polyglot persistence applications (gluecon 2013)
PDF
전문가토크릴레이 1탄 html5 전망 (전종홍 박사)
PPT
Turbo Enterprise Web 2.0 Ajax World 20081
PDF
Decomposing applications for scalability and deployability (devnexus 2013)
PDF
Professional Frontend Engineering
Dave Carroll Application Services Salesforce
Developing polyglot persistence applications (gluecon 2013)
전문가토크릴레이 1탄 html5 전망 (전종홍 박사)
Turbo Enterprise Web 2.0 Ajax World 20081
Decomposing applications for scalability and deployability (devnexus 2013)
Professional Frontend Engineering
Ad

Viewers also liked (20)

PDF
Швейцарский нож для Android
PDF
Проблемы автоматизации крупных проектов: TestComplete
PDF
Автоматизация тестирования как сервис
PDF
Codeception - WTF?
PDF
“Обезьянье тестирование” в мобильных проектах
PDF
Совершенный тестовый фреймворк
PDF
Why it is not working
PDF
Курс молодого бойца-автоматизатора – как стать ветераном и остаться в живых
PDF
Быстрое расширение Robot Framework под свои нужды с использованием Python
PDF
Фреймворк для регрессионного тестирования на основе WebDriver
PDF
За пределами PageObject
PDF
В поисках магической кнопки или как приручить SOAP UI
PDF
Александр Кабалюк – SilkTest
PDF
Vaadin scalability-slides
PDF
Философия и построение тестового фреймворка на основе BDD в PHP проектах
PPTX
Тестирование производительности клиентсайда
PDF
JavaCro'14 - Building interactive web applications with Vaadin – Peter Lehto
PPTX
Автоматизация тестирования веб-сервисов посредством SOAP UI
PDF
Github Flow. Тестировщики против тестирования
PPTX
Практика тестирования web сервисов
Швейцарский нож для Android
Проблемы автоматизации крупных проектов: TestComplete
Автоматизация тестирования как сервис
Codeception - WTF?
“Обезьянье тестирование” в мобильных проектах
Совершенный тестовый фреймворк
Why it is not working
Курс молодого бойца-автоматизатора – как стать ветераном и остаться в живых
Быстрое расширение Robot Framework под свои нужды с использованием Python
Фреймворк для регрессионного тестирования на основе WebDriver
За пределами PageObject
В поисках магической кнопки или как приручить SOAP UI
Александр Кабалюк – SilkTest
Vaadin scalability-slides
Философия и построение тестового фреймворка на основе BDD в PHP проектах
Тестирование производительности клиентсайда
JavaCro'14 - Building interactive web applications with Vaadin – Peter Lehto
Автоматизация тестирования веб-сервисов посредством SOAP UI
Github Flow. Тестировщики против тестирования
Практика тестирования web сервисов
Ad

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

PDF
Shreeraj - Hacking Web 2 0 - ClubHack2007
PDF
Shreeraj-Hacking_Web_2
PDF
adrian coyler open tour keynote
PDF
Hacking Ajax & Web Services - Next Generation Web Attacks on the Rise
PDF
Modern Architectures with Spring and JavaScript
PDF
Modern Architectures with Spring and JavaScript
PDF
A Snapshot of the Mobile HTML5 Revolution
PPT
Ajax Ppt 1
PPTX
Building rich Single Page Applications (SPAs) for desktop, mobile, and tablet...
PPTX
Connected Web Systems
PDF
Application Security Workshop
PDF
Vaadin - Rich Web Applications in Server-side Java without Plug-ins or JavaSc...
PDF
What is HTML5
PPT
Using Ajax In Domino Web Applications
PDF
Ajax
PPTX
Uni Paa S Overview
PPTX
Soa development using javascript
PDF
Cross platform mobile web apps
PDF
Legacy java ee meet lambda
PPT
Jax Ajax Architecture
Shreeraj - Hacking Web 2 0 - ClubHack2007
Shreeraj-Hacking_Web_2
adrian coyler open tour keynote
Hacking Ajax & Web Services - Next Generation Web Attacks on the Rise
Modern Architectures with Spring and JavaScript
Modern Architectures with Spring and JavaScript
A Snapshot of the Mobile HTML5 Revolution
Ajax Ppt 1
Building rich Single Page Applications (SPAs) for desktop, mobile, and tablet...
Connected Web Systems
Application Security Workshop
Vaadin - Rich Web Applications in Server-side Java without Plug-ins or JavaSc...
What is HTML5
Using Ajax In Domino Web Applications
Ajax
Uni Paa S Overview
Soa development using javascript
Cross platform mobile web apps
Legacy java ee meet lambda
Jax Ajax Architecture

More from automated-testing.info (15)

PDF
Keyword driven testing
PPTX
Andrey Azimov - Как найти работу тестировщику?
PPT
Jenkins auto configureforbranch-php
PPTX
Иван Бордюг - Инструмент автоматизации регрессионного тестирования на основе ...
PPT
Alexei Zozulenko - Test automation failure
PPTX
Vladimir Primakov - Test Automation By Example
PPTX
Codeception Introduction
PPTX
Ivan Bordug Test Automation Story
PPTX
Alexander Zvonov Test Automation Story
PPTX
Daria Chernishova Test Automation Story
PDF
Bdd with java using concordion and selenium ui tests
PDF
Bdd + SpecFlow + WatiN
PDF
Efficient performance testing
PPTX
Qtp Automation and Extensibility
PPTX
Page Object Pattern
Keyword driven testing
Andrey Azimov - Как найти работу тестировщику?
Jenkins auto configureforbranch-php
Иван Бордюг - Инструмент автоматизации регрессионного тестирования на основе ...
Alexei Zozulenko - Test automation failure
Vladimir Primakov - Test Automation By Example
Codeception Introduction
Ivan Bordug Test Automation Story
Alexander Zvonov Test Automation Story
Daria Chernishova Test Automation Story
Bdd with java using concordion and selenium ui tests
Bdd + SpecFlow + WatiN
Efficient performance testing
Qtp Automation and Extensibility
Page Object Pattern

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

  • 1. Performance Testing AJAX Application with JMeter Vladimir Primakov atdays.com
  • 2. Agenda AJAX Main Difficulties of Performance Testing of AJAX applications with jmeter and their Solutions Conclusions Questions atdays.com #atdays 2
  • 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: [email protected] Skype: vladimir.primakov atdays.com #atdays 3
  • 4. AJAX – XMLHttpRequest + DHTML (HTML, CSS, Javascript) AJAX - ASYNCHRONOUS JAVASCRIPT AND XML atdays.com #atdays 4
  • 5. Classic and Ajax Web-apps atdays.com #atdays 5
  • 6. Classic and Ajax Web-apps Classic Browser Client Server Side Web-server Data store, GUI backend processing atdays.com #atdays 6
  • 7. Classic and Ajax Web-apps Classic Browser Client Server Side Http Request Web-server Data store, http(s) transport backend GUI processing atdays.com #atdays 7
  • 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 data atdays.com #atdays 8
  • 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 server atdays.com #atdays 9
  • 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 server atdays.com #atdays 10
  • 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 object atdays.com #atdays 11
  • 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 object atdays.com #atdays 12
  • 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/JSON atdays.com #atdays 13
  • 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/JSON atdays.com #atdays 14
  • 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 - Small atdays.com #atdays 15
  • 16. Classic Request Response Post HTML Page atdays.com #atdays 16
  • 17. Classic Request Response Post HTML Page Request AJAX JSON Response Post Part of a page a) b) atdays.com #atdays 17
  • 18. (AJAX) JSON Response Part of a page a) b) atdays.com #atdays 18
  • 19. Vaadin}> (GWT) Ajax framework atdays.com #atdays 19
  • 20. Vaadin}> (GWT) Ajax framework Server Side Backend Processing Browser Client Vaadin GWT widgets Server-side GUI GWT Web Java GUI Server (javascript) objects UIDL - User Interface Description Language atdays.com #atdays 20
  • 21. Vaadin}> (GWT) Ajax framework Server Side Backend Processing Browser Client Vaadin GWT widgets Server-side GUI GWT Mirroring (GUI) Web Java GUI Server (javascript) objects UIDL - User Interface Description Language atdays.com #atdays 21
  • 22. Vaadin}> (GWT) Ajax framework Server Side Backend Processing Browser Client Vaadin GWT widgets Server-side GUI GWT Web Java GUI Server (javascript) objects UIDL - User Interface Description Language atdays.com #atdays 22
  • 23. Vaadin}> (GWT) Ajax framework Server Side Backend Processing Browser Client Vaadin GWT widgets UIDL Server-side GUI GWT Vaadin Web Java GUI Engine Server (javascript) objects (javascript) UIDL - User Interface Description Language atdays.com #atdays 23
  • 24. Vaadin}> (GWT) Ajax framework Server Side Backend Processing Browser Client JSON (UIDL) Vaadin GWT widgets UIDL Server-side GUI GWT Vaadin Web Java GUI Engine Server (javascript) objects (javascript) UIDL - User Interface Description Language atdays.com #atdays 24
  • 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 Language atdays.com #atdays 25
  • 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 Language atdays.com #atdays 26
  • 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 Language atdays.com #atdays 27
  • 28. UIDL Request (Post) (Show Notifications window) (UIDL) JSON Response (Rendering Notifications window) atdays.com #atdays 28
  • 29. UIDL Request (Post) (Show Notifications window) (UIDL) JSON Response (Rendering Notifications window) atdays.com #atdays 29
  • 30. UIDL Request (Post) (Show Notifications window) (UIDL) JSON Response (Rendering Notifications window) Element Type Paintable ID Arguments atdays.com #atdays 30
  • 31. MAIN DIFFICULTIES OF PERFORMANCE TESTING OF AJAX APPLICATIONS WITH JMETER AND THEIR SOLUTIONS atdays.com #atdays 31
  • 32. MAIN DIFFICULTIES OF PERFORMANCE TESTING OF AJAX APPLICATIONS WITH JMETER AND THEIR SOLUTIONS atdays.com #atdays 32
  • 33. MAIN DIFFICULTIES OF PERFORMANCE TESTING OF AJAX APPLICATIONS WITH JMETER AND THEIR SOLUTIONS atdays.com #atdays 33
  • 34. MAIN DIFFICULTIES OF PERFORMANCE TESTING OF AJAX APPLICATIONS WITH JMETER AND THEIR SOLUTIONS atdays.com #atdays 34
  • 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 Retest atdays.com #atdays 35
  • 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 Retest atdays.com #atdays 36
  • 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 requests atdays.com #atdays 37
  • 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. SOLUTIONS atdays.com #atdays 40
  • 40. Unreadable Responses/Requests atdays.com #atdays 41
  • 41. Unreadable Responses/Requests 1. Get used to this format atdays.com #atdays 42
  • 42. 2. Use JSON Viewers atdays.com #atdays 43
  • 43. 3. Use JSON Parsers atdays.com #atdays 44
  • 44. 4. Parse JSON Yourself atdays.com #atdays 45
  • 45. Hard to find consistency between Responses/Requests and GUI elements atdays.com #atdays 46
  • 46. Hard to find consistency between Responses/Requests and GUI elements 1. Use self-explanatory named IDs (classes) for GUI elements atdays.com #atdays 47
  • 47. Hard to find consistency between Responses/Requests and GUI elements 1. Use self-explanatory named IDs (classes) for GUI elements atdays.com #atdays 48
  • 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 ticket atdays.com #atdays 50
  • 50. 1) Creating a ticket via email (SMTP Sampler) 2. Use Anchors atdays.com #atdays 51
  • 51. 1) Creating a ticket via email (SMTP Sampler) 2. Use Anchors 2) Login into the Ticket System atdays.com #atdays 52
  • 52. 1) Creating a ticket via email (SMTP Sampler) 2. Use Anchors 2) Login into the Ticket System 3) Request to show tickets atdays.com #atdays 53
  • 53. 1) Creating a ticket via email (SMTP Sampler) 2. Use Anchors 2) Login into the Ticket System 3) Request to show tickets 4) JSON Response (Tickets page) atdays.com #atdays 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 created 3) Request to show tickets 4) JSON Response (Tickets page) atdays.com #atdays 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 created 3) Request to show tickets 4) JSON Response (Tickets page) 6) Extracting ticket ID (Regular Expression Extractor) atdays.com #atdays 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 created 3) 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
  • 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. 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. 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 anchors atdays.com #atdays 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 matters atdays.com #atdays 62
  • 62. Sequential dependency between requests Define definite initial data in the tested application atdays.com #atdays 63
  • 63. Sequential dependency between requests Define definite initial data in the tested application Breakdown scenarios into undependable chunks atdays.com #atdays 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 chunks atdays.com #atdays 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. Example atdays.com #atdays 68
  • 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. 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 it atdays.com #atdays 70
  • 69. Error requests are not evident (Vaadin) The response code for Vaadin “Out of Sync” and other response Errors is still HTTP/1.1 200 atdays.com #atdays 71
  • 70. Put Global Response Assertion on the test plan level atdays.com #atdays 72
  • 71. Too many requests (Vaadin) atdays.com #atdays 73
  • 72. Too many requests (Vaadin) Get used to it!  atdays.com #atdays 74
  • 73. Other Problems Difficulty to make estimations Script creation for (full) AJAX application takes ~ 3-4 times more than for Classic application atdays.com #atdays 75
  • 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
  • 76. Vladimir Primakov Email: [email protected] Skype: vladimir.primakov atdays.com #atdays 78