DZone
Thanks for visiting DZone today,
Edit Profile
  • Manage Email Subscriptions
  • How to Post to DZone
  • Article Submission Guidelines
Sign Out View Profile
  • Post an Article
  • Manage My Drafts
Over 2 million developers have joined DZone.
Log In / Join
Please enter at least three characters to search
Refcards Trend Reports
Events Video Library
Refcards
Trend Reports

Events

View Events Video Library

Zones

Culture and Methodologies Agile Career Development Methodologies Team Management
Data Engineering AI/ML Big Data Data Databases IoT
Software Design and Architecture Cloud Architecture Containers Integration Microservices Performance Security
Coding Frameworks Java JavaScript Languages Tools
Testing, Deployment, and Maintenance Deployment DevOps and CI/CD Maintenance Monitoring and Observability Testing, Tools, and Frameworks
Culture and Methodologies
Agile Career Development Methodologies Team Management
Data Engineering
AI/ML Big Data Data Databases IoT
Software Design and Architecture
Cloud Architecture Containers Integration Microservices Performance Security
Coding
Frameworks Java JavaScript Languages Tools
Testing, Deployment, and Maintenance
Deployment DevOps and CI/CD Maintenance Monitoring and Observability Testing, Tools, and Frameworks

Modernize your data layer. Learn how to design cloud-native database architectures to meet the evolving demands of AI and GenAI workkloads.

Secure your stack and shape the future! Help dev teams across the globe navigate their software supply chain security challenges.

Releasing software shouldn't be stressful or risky. Learn how to leverage progressive delivery techniques to ensure safer deployments.

Avoid machine learning mistakes and boost model performance! Discover key ML patterns, anti-patterns, data strategies, and more.

Related

  • Creating a Web Project: Key Steps to Identify Issues
  • Kubernetes Ephemeral Containers: Enhancing Security and Streamlining Troubleshooting in Production Clusters
  • Organizing Logging Between the Three IBM App Connect Form Factors
  • Spring Boot GoT: Game of Trace!

Trending

  • Unlocking the Potential of Apache Iceberg: A Comprehensive Analysis
  • How the Go Runtime Preempts Goroutines for Efficient Concurrency
  • Mastering Fluent Bit: Installing and Configuring Fluent Bit on Kubernetes (Part 3)
  • While Performing Dependency Selection, I Avoid the Loss Of Sleep From Node.js Libraries' Dangers
  1. DZone
  2. Testing, Deployment, and Maintenance
  3. Maintenance
  4. 3 Ways to Debug JMeter Scripts

3 Ways to Debug JMeter Scripts

Learn three ways to debug your JMeter scripts if you're having problems when load testing.

By 
Canberk Akduygu user avatar
Canberk Akduygu
·
Nov. 21, 18 · Tutorial
Likes (1)
Comment
Save
Tweet
Share
15.7K Views

Join the DZone community and get the full member experience.

Join For Free

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.

Here are some ways to debug a JMeter script.

1. View Result Tree

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. There are many different types for that.

In that screen you see the content of your request, response and sampler itself with the headers, status code etc. Also 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.

But 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”.

So you can right your queries and validate if they are working fine or not.

Here’s another example with Regular Expression Tester.

Using that listener is efficient than modifying an existing script and playing once again until you find the right selector or values.

Not: 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.

2. Log Viewer

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.

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…)

3. Debug Sampler

Debug Sampler is a very powerful sampler which does nothing but logging. You can log JMeter Properties, JMeter Variables or System Properties. Think about 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.

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.

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.

Happy load testing! 

Debug (command)

Published at DZone with permission of Canberk Akduygu. See the original article here.

Opinions expressed by DZone contributors are their own.

Related

  • Creating a Web Project: Key Steps to Identify Issues
  • Kubernetes Ephemeral Containers: Enhancing Security and Streamlining Troubleshooting in Production Clusters
  • Organizing Logging Between the Three IBM App Connect Form Factors
  • Spring Boot GoT: Game of Trace!

Partner Resources

×

Comments
Oops! Something Went Wrong

The likes didn't load as expected. Please refresh the page and try again.

ABOUT US

  • About DZone
  • Support and feedback
  • Community research
  • Sitemap

ADVERTISE

  • Advertise with DZone

CONTRIBUTE ON DZONE

  • Article Submission Guidelines
  • Become a Contributor
  • Core Program
  • Visit the Writers' Zone

LEGAL

  • Terms of Service
  • Privacy Policy

CONTACT US

  • 3343 Perimeter Hill Drive
  • Suite 100
  • Nashville, TN 37211
  • support@dzone.com

Let's be friends:

Likes
There are no likes...yet! 👀
Be the first to like this post!
It looks like you're not logged in.
Sign in to see who liked this post!