SlideShare a Scribd company logo
1 of 14
3 Ways of Debugging JMeter Scripts
DEBUGGING JMETER
SCRIPTS
1
In case you have worked with JMeter scripts
before, you must have stuck at some point and
find yourself asking “How do I debug this stuff?”,
“Why is my regular expression or jsonpath not
working?”
Actually, there are many ways to debug JMeter
scripts and it’s very easy!
Let’s see some ways to debug a JMeter script.
VIEW RESULT TREE
2
JMeter has various listener types. View Result Tree is the one that should be used to debug any request. It allows you to
debug Jsonpath, XML or a Regular expression by its user interface. It can be added to your JMeter script through right-click
menu: Add > Listener > View Results Tree.
After executing any scripts, you can go into your “View Result Tree” and select the debug type.
VIEW RESULT TREE
3
In that screen you see the content of your request,
response and sampler itself with the headers,
status code etc.
As default, Debugging option “Text” is selected on
the left hand side of the screen.
When you open ‘Response Data’ you will be able
to search for any textual or numeric value in the
response as “Text” is selected.
VIEW RESULT TREE
4
You might need to search something from a json or xml response. In those cases, listener allows you to choose “CSS
Selector Tester”, “Json Path Tester” or “XML Path Tester”
VIEW RESULT TREE
5
You can right your queries and validate if they are working fine or not.
VIEW RESULT TREE
6
Here’s another example with Regular Expression Tester:
VIEW RESULT TREE
7
Using that listener is efficient than modifying
already existing script and playing once again till
you find the right selector or values.
Note: While executing your performance test,
don’t forget to disable View Tree Listener as it
stores everything in the memory and it will crash
your execution by consuming the memory.
LOG VIEWER
8
JMeter has a console that allows you to monitor the script on runtime. You can turn on the log viewer from the top menu by
following “Options->Log Viewer”.
So at the bottom of your JMeter client, a panel will open. It will tell you what’s going on with your script.
LOG VIEWER
9
You can configure the Log level by selecting
INFO, WARN, ERROR, DEBUG, TRACE from the
top menu.
 DEBUG and TRACE logs everything about the
test. Request, response, headers, JMeter
status with Threads, etc…
 WARN will log only the warning generated by
JMeter.
 INFO will log only Thread status, you will not
see any response or request specific data.
 ERROR will only log in case there are any
errors caused by test (failing request) or
environment (missing CSV file or JDK path
etc…)
DEBUG SAMPLER
10
Debug Sampler is a very powerful sampler which
does nothing but logging.
You can log JMeter Properties, JMeter Variables
or System Properties. Think that you have a JDK
installation problem in your machine. Debug
Sampler tells you.
You have many variables that you extract from
your request and use in other requests. Debug
sampler gathers all of them in one place and show
their values.
DEBUG SAMPLER
11
You can add it by right clicking on your Thread Group and select “Add->Sampler->Debug Sampler”.
Then you configure this sampler for logging level.
DEBUG SAMPLER
12
Most important one is to Enable “JMeter Variables” so you’ll be able to monitor any variable create during performance test
runtime.
In that picture, there is id and title value which are extracted from a Jsonpath Post Precessor.
13
Loadium; cloud-based performance & load testing platform handles all of the
configuration steps for real-time test reporting results and eliminates the required
setup time.
You only need to upload JMeter or web driver based tests to Loadium and execute it!
Please feel free to ask questions if you have any!
Happy load testing!

More Related Content

Similar to 3 Ways of Debugging JMeter Scripts

Performance testing using Jmeter for apps which needs authentication
Performance testing using Jmeter for apps which needs authenticationPerformance testing using Jmeter for apps which needs authentication
Performance testing using Jmeter for apps which needs authentication
Jay Jha
 
Jmeter proxy step_by_step
Jmeter proxy step_by_stepJmeter proxy step_by_step
Jmeter proxy step_by_step
Kapil Chawla
 
J analyser jmeter_analysys
J analyser jmeter_analysysJ analyser jmeter_analysys
J analyser jmeter_analysys
Anil Kumar
 
jmeter - Google Search.pdf
jmeter - Google Search.pdfjmeter - Google Search.pdf
jmeter - Google Search.pdf
MohanKoppala3
 

Similar to 3 Ways of Debugging JMeter Scripts (20)

Performance testing using Jmeter for apps which needs authentication
Performance testing using Jmeter for apps which needs authenticationPerformance testing using Jmeter for apps which needs authentication
Performance testing using Jmeter for apps which needs authentication
 
Day1_Apache_JMeter_Overview
Day1_Apache_JMeter_OverviewDay1_Apache_JMeter_Overview
Day1_Apache_JMeter_Overview
 
Mastering Distributed Performance Testing
Mastering Distributed Performance TestingMastering Distributed Performance Testing
Mastering Distributed Performance Testing
 
jmeter interview q.pdf
jmeter interview q.pdfjmeter interview q.pdf
jmeter interview q.pdf
 
Introduction to jmeter & how to view jmeter Test Result in Real-Time
Introduction to jmeter & how to view jmeter Test Result in Real-TimeIntroduction to jmeter & how to view jmeter Test Result in Real-Time
Introduction to jmeter & how to view jmeter Test Result in Real-Time
 
J meter guide
J meter guideJ meter guide
J meter guide
 
Automation - Apache JMeter
Automation - Apache JMeterAutomation - Apache JMeter
Automation - Apache JMeter
 
Jmeter proxy step_by_step
Jmeter proxy step_by_stepJmeter proxy step_by_step
Jmeter proxy step_by_step
 
Jmeter introduction
Jmeter introductionJmeter introduction
Jmeter introduction
 
J analyser jmeter_analysys
J analyser jmeter_analysysJ analyser jmeter_analysys
J analyser jmeter_analysys
 
Apache J meter
Apache J meterApache J meter
Apache J meter
 
Top 20 JMeter Interview Questions and Answers in 2023.pptx
Top 20 JMeter Interview Questions and Answers in 2023.pptxTop 20 JMeter Interview Questions and Answers in 2023.pptx
Top 20 JMeter Interview Questions and Answers in 2023.pptx
 
apache_jmeter.pptx
apache_jmeter.pptxapache_jmeter.pptx
apache_jmeter.pptx
 
JMeter Post-Processors
JMeter Post-ProcessorsJMeter Post-Processors
JMeter Post-Processors
 
Top 20 JMeter Interview Questions and Answers in 2023.pdf
Top 20 JMeter Interview Questions and Answers in 2023.pdfTop 20 JMeter Interview Questions and Answers in 2023.pdf
Top 20 JMeter Interview Questions and Answers in 2023.pdf
 
jmeter - Google Search.pdf
jmeter - Google Search.pdfjmeter - Google Search.pdf
jmeter - Google Search.pdf
 
Performance testing and j meter
Performance testing and j meterPerformance testing and j meter
Performance testing and j meter
 
Introduction to JMeter
Introduction to JMeterIntroduction to JMeter
Introduction to JMeter
 
J meter
J meterJ meter
J meter
 
Katalon Studio - GUI Overview
Katalon Studio - GUI OverviewKatalon Studio - GUI Overview
Katalon Studio - GUI Overview
 

Recently uploaded

Team Transformation Tactics for Holistic Testing and Quality (NewCrafts Paris...
Team Transformation Tactics for Holistic Testing and Quality (NewCrafts Paris...Team Transformation Tactics for Holistic Testing and Quality (NewCrafts Paris...
Team Transformation Tactics for Holistic Testing and Quality (NewCrafts Paris...
Lisi Hocke
 
Abortion Pills For Sale WhatsApp[[+27737758557]] In Birch Acres, Abortion Pil...
Abortion Pills For Sale WhatsApp[[+27737758557]] In Birch Acres, Abortion Pil...Abortion Pills For Sale WhatsApp[[+27737758557]] In Birch Acres, Abortion Pil...
Abortion Pills For Sale WhatsApp[[+27737758557]] In Birch Acres, Abortion Pil...
drm1699
 

Recently uploaded (20)

GraphSummit Milan - Neo4j: The Art of the Possible with Graph
GraphSummit Milan - Neo4j: The Art of the Possible with GraphGraphSummit Milan - Neo4j: The Art of the Possible with Graph
GraphSummit Milan - Neo4j: The Art of the Possible with Graph
 
Incident handling is a clearly defined set of procedures to manage and respon...
Incident handling is a clearly defined set of procedures to manage and respon...Incident handling is a clearly defined set of procedures to manage and respon...
Incident handling is a clearly defined set of procedures to manage and respon...
 
The Strategic Impact of Buying vs Building in Test Automation
The Strategic Impact of Buying vs Building in Test AutomationThe Strategic Impact of Buying vs Building in Test Automation
The Strategic Impact of Buying vs Building in Test Automation
 
COMPUTER AND ITS COMPONENTS PPT.by naitik sharma Class 9th A mittal internati...
COMPUTER AND ITS COMPONENTS PPT.by naitik sharma Class 9th A mittal internati...COMPUTER AND ITS COMPONENTS PPT.by naitik sharma Class 9th A mittal internati...
COMPUTER AND ITS COMPONENTS PPT.by naitik sharma Class 9th A mittal internati...
 
Abortion Pill Prices Mthatha (@](+27832195400*)[ 🏥 Women's Abortion Clinic In...
Abortion Pill Prices Mthatha (@](+27832195400*)[ 🏥 Women's Abortion Clinic In...Abortion Pill Prices Mthatha (@](+27832195400*)[ 🏥 Women's Abortion Clinic In...
Abortion Pill Prices Mthatha (@](+27832195400*)[ 🏥 Women's Abortion Clinic In...
 
Anypoint Code Builder - Munich MuleSoft Meetup - 16th May 2024
Anypoint Code Builder - Munich MuleSoft Meetup - 16th May 2024Anypoint Code Builder - Munich MuleSoft Meetup - 16th May 2024
Anypoint Code Builder - Munich MuleSoft Meetup - 16th May 2024
 
Wired_2.0_CREATE YOUR ULTIMATE LEARNING ENVIRONMENT_JCON_16052024
Wired_2.0_CREATE YOUR ULTIMATE LEARNING ENVIRONMENT_JCON_16052024Wired_2.0_CREATE YOUR ULTIMATE LEARNING ENVIRONMENT_JCON_16052024
Wired_2.0_CREATE YOUR ULTIMATE LEARNING ENVIRONMENT_JCON_16052024
 
The mythical technical debt. (Brooke, please, forgive me)
The mythical technical debt. (Brooke, please, forgive me)The mythical technical debt. (Brooke, please, forgive me)
The mythical technical debt. (Brooke, please, forgive me)
 
Alluxio Monthly Webinar | Simplify Data Access for AI in Multi-Cloud
Alluxio Monthly Webinar | Simplify Data Access for AI in Multi-CloudAlluxio Monthly Webinar | Simplify Data Access for AI in Multi-Cloud
Alluxio Monthly Webinar | Simplify Data Access for AI in Multi-Cloud
 
Effective Strategies for Wix's Scaling challenges - GeeCon
Effective Strategies for Wix's Scaling challenges - GeeConEffective Strategies for Wix's Scaling challenges - GeeCon
Effective Strategies for Wix's Scaling challenges - GeeCon
 
Abortion Pill Prices Germiston ](+27832195400*)[ 🏥 Women's Abortion Clinic in...
Abortion Pill Prices Germiston ](+27832195400*)[ 🏥 Women's Abortion Clinic in...Abortion Pill Prices Germiston ](+27832195400*)[ 🏥 Women's Abortion Clinic in...
Abortion Pill Prices Germiston ](+27832195400*)[ 🏥 Women's Abortion Clinic in...
 
From Knowledge Graphs via Lego Bricks to scientific conversations.pptx
From Knowledge Graphs via Lego Bricks to scientific conversations.pptxFrom Knowledge Graphs via Lego Bricks to scientific conversations.pptx
From Knowledge Graphs via Lego Bricks to scientific conversations.pptx
 
Team Transformation Tactics for Holistic Testing and Quality (NewCrafts Paris...
Team Transformation Tactics for Holistic Testing and Quality (NewCrafts Paris...Team Transformation Tactics for Holistic Testing and Quality (NewCrafts Paris...
Team Transformation Tactics for Holistic Testing and Quality (NewCrafts Paris...
 
Encryption Recap: A Refresher on Key Concepts
Encryption Recap: A Refresher on Key ConceptsEncryption Recap: A Refresher on Key Concepts
Encryption Recap: A Refresher on Key Concepts
 
From Theory to Practice: Utilizing SpiraPlan's REST API
From Theory to Practice: Utilizing SpiraPlan's REST APIFrom Theory to Practice: Utilizing SpiraPlan's REST API
From Theory to Practice: Utilizing SpiraPlan's REST API
 
Abortion Pill Prices Turfloop ](+27832195400*)[ 🏥 Women's Abortion Clinic in ...
Abortion Pill Prices Turfloop ](+27832195400*)[ 🏥 Women's Abortion Clinic in ...Abortion Pill Prices Turfloop ](+27832195400*)[ 🏥 Women's Abortion Clinic in ...
Abortion Pill Prices Turfloop ](+27832195400*)[ 🏥 Women's Abortion Clinic in ...
 
Abortion Pills For Sale WhatsApp[[+27737758557]] In Birch Acres, Abortion Pil...
Abortion Pills For Sale WhatsApp[[+27737758557]] In Birch Acres, Abortion Pil...Abortion Pills For Sale WhatsApp[[+27737758557]] In Birch Acres, Abortion Pil...
Abortion Pills For Sale WhatsApp[[+27737758557]] In Birch Acres, Abortion Pil...
 
CERVED e Neo4j su una nuvola, migrazione ed evoluzione di un grafo mission cr...
CERVED e Neo4j su una nuvola, migrazione ed evoluzione di un grafo mission cr...CERVED e Neo4j su una nuvola, migrazione ed evoluzione di un grafo mission cr...
CERVED e Neo4j su una nuvola, migrazione ed evoluzione di un grafo mission cr...
 
Navigation in flutter – how to add stack, tab, and drawer navigators to your ...
Navigation in flutter – how to add stack, tab, and drawer navigators to your ...Navigation in flutter – how to add stack, tab, and drawer navigators to your ...
Navigation in flutter – how to add stack, tab, and drawer navigators to your ...
 
Transformer Neural Network Use Cases with Links
Transformer Neural Network Use Cases with LinksTransformer Neural Network Use Cases with Links
Transformer Neural Network Use Cases with Links
 

3 Ways of Debugging JMeter Scripts

  • 1. 3 Ways of Debugging JMeter Scripts
  • 2. DEBUGGING JMETER SCRIPTS 1 In case you have worked with JMeter scripts before, you must have stuck at some point and find yourself asking “How do I debug this stuff?”, “Why is my regular expression or jsonpath not working?” Actually, there are many ways to debug JMeter scripts and it’s very easy! Let’s see some ways to debug a JMeter script.
  • 3. VIEW RESULT TREE 2 JMeter has various listener types. View Result Tree is the one that should be used to debug any request. It allows you to debug Jsonpath, XML or a Regular expression by its user interface. It can be added to your JMeter script through right-click menu: Add > Listener > View Results Tree. After executing any scripts, you can go into your “View Result Tree” and select the debug type.
  • 4. VIEW RESULT TREE 3 In that screen you see the content of your request, response and sampler itself with the headers, status code etc. As default, Debugging option “Text” is selected on the left hand side of the screen. When you open ‘Response Data’ you will be able to search for any textual or numeric value in the response as “Text” is selected.
  • 5. VIEW RESULT TREE 4 You might need to search something from a json or xml response. In those cases, listener allows you to choose “CSS Selector Tester”, “Json Path Tester” or “XML Path Tester”
  • 6. VIEW RESULT TREE 5 You can right your queries and validate if they are working fine or not.
  • 7. VIEW RESULT TREE 6 Here’s another example with Regular Expression Tester:
  • 8. VIEW RESULT TREE 7 Using that listener is efficient than modifying already existing script and playing once again till you find the right selector or values. Note: While executing your performance test, don’t forget to disable View Tree Listener as it stores everything in the memory and it will crash your execution by consuming the memory.
  • 9. LOG VIEWER 8 JMeter has a console that allows you to monitor the script on runtime. You can turn on the log viewer from the top menu by following “Options->Log Viewer”. So at the bottom of your JMeter client, a panel will open. It will tell you what’s going on with your script.
  • 10. LOG VIEWER 9 You can configure the Log level by selecting INFO, WARN, ERROR, DEBUG, TRACE from the top menu.  DEBUG and TRACE logs everything about the test. Request, response, headers, JMeter status with Threads, etc…  WARN will log only the warning generated by JMeter.  INFO will log only Thread status, you will not see any response or request specific data.  ERROR will only log in case there are any errors caused by test (failing request) or environment (missing CSV file or JDK path etc…)
  • 11. DEBUG SAMPLER 10 Debug Sampler is a very powerful sampler which does nothing but logging. You can log JMeter Properties, JMeter Variables or System Properties. Think that you have a JDK installation problem in your machine. Debug Sampler tells you. You have many variables that you extract from your request and use in other requests. Debug sampler gathers all of them in one place and show their values.
  • 12. DEBUG SAMPLER 11 You can add it by right clicking on your Thread Group and select “Add->Sampler->Debug Sampler”. Then you configure this sampler for logging level.
  • 13. DEBUG SAMPLER 12 Most important one is to Enable “JMeter Variables” so you’ll be able to monitor any variable create during performance test runtime. In that picture, there is id and title value which are extracted from a Jsonpath Post Precessor.
  • 14. 13 Loadium; cloud-based performance & load testing platform handles all of the configuration steps for real-time test reporting results and eliminates the required setup time. You only need to upload JMeter or web driver based tests to Loadium and execute it! Please feel free to ask questions if you have any! Happy load testing!