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

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

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

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

  • Living in a World Without Neil Peart
  • The Rise of Shadow AI: When Innovation Outpaces Governance
  • React’s Unstoppable Rise: Why It’s Here to Stay
  • Process Mining Key Elements

Trending

  • Unlocking AI Coding Assistants Part 3: Generating Diagrams, Open API Specs, And Test Data
  • Testing SingleStore's MCP Server
  • Integrating Security as Code: A Necessity for DevSecOps
  • Unlocking the Potential of Apache Iceberg: A Comprehensive Analysis

A Step-by-Step Debugger for JMeter: It’s Not a Dream Anymore

Check out this thorough review of the features of JMeter's step-by-step debugger.

By 
Refael Botbol user avatar
Refael Botbol
·
Jun. 09, 16 · Opinion
Likes (3)
Comment
Save
Tweet
Share
10.4K Views

Join the DZone community and get the full member experience.

Join For Free

We’ve covered various ways to debug scripts in JMeter, but now you have the ability to debug scripts step-by-step and receive updates in real time. Here’s how.

Exit Complexity, Enter Simplicity

When I started to work with JMeter to create scripts, I was (as I’m sure we all do) feeling like debugging my scripts was way too cumbersome a process. By using the Debug Sampler and log() functions, it really felt like the old mainframe debugging days.

I wished we could just have a normal step-by-step debug, just like any normal IDE (integrated development environment), to debug my scripts and find issues.

Now, because of BlazeMeter, that day has finally come. BlazeMeter has created a step-by-step debugger, and here is how to get it:

By using the Plugin Manager (you don’t have it yet ?!) you can get the step-by-step debugger with just four easy steps:

  1. Open JMeter and go to the Options->Plugin Manager
  2. Switch to “Available Plugins” tab
  3. Select the “BlazeMeter Step-by-Step Debugger”
  4. Click “Apply Changes and Restart JMeter”

Once JMeter will relaunch itself, you should see the debugger plugin under “Installed plugins”.

JMeter Step-by-Step Debugger

Now, let’s go for a short tour to use it. For that, I’ve prepared a JMX file (attached) as an example in order to show you how to use the debugger features.

Features of the Step-by-Step JMeter Debugger

Feature 1: Running your Script Using the Debugger

  1. Go to Run-> Step by Step Debugger
  2. Maximize the pop-up window and click the “Start” button at the upper right corner
  3. You probably noticed that:
    1. Sample #1 is highlighted in Blue
    2. General Constant Timer is now in focus

This is because the debugger follows the JMeter scoping rules, which means execute the timer and then execute the sample. The debugger will always focus on the next element to be executed.

Feature 2: Step by Step: Let’s See These Variables!

  1. Press the “Step Over” button
  2. You probably noticed that the focus just switched to Sampler #1
  3. By pressing another “Step Over”, you will move to the Regular Expression execution
  4. Another “Step Over” will bring us to the “View Results Tree”
  5. Since the RegEx has been evaluated, you can see in the Variables tab that “RegExResponse” is now containing the string yada yada yada


JMeter Step-by-Step Debugger

Feature 3: Stop Before and After Listener Executions

You might be wondering what will happen in the next “Step Over”. Let’s find out.

Click it again.

You might have noticed that we are still in the “View Results Tree” listener even though it has been executed. Why?

Well, it’s not a bug. We just figured out that you will probably want to see the results before moving to the next element. So we might not want to switch the focus to sample #2 just yet.

Fun, ha… :)

(We would also remove any disabled elements—just to make your script cleaner while you debug it.)

Feature 4: Breakpoints

Just like any other IDE, we have breakpoints, just to save you gazillions of “Step Over” clicks. Let’s put a breakpoint on “Sample #2” by right clicking on it and select “breakpoint”. Then close and reopen the debugger, and then click on the “Continue” button. The debugger has stopped at Sample #2, just before it’s starting to execute its scope.

Feature 5: Evaluate Things on the Fly

You know the feeling when you want to see the value of a variable/function and monitor when it has been changed? Meet the Evaluate tab.

  1. Let’s restart the debugger from scratch and put a breakpoint on the RegEx2 element (under sample #2)
  2. Now before pressing “Continue”, let’s go to the Evaluate tab and put our #RegEx variable name (RegExTimestamp) in the JMeter expression line.
  3. Press “Continue” and wait for the debugger to stop before executing the RegEx
  4. You may notice that the value of the JMeter expression ${RegExTimestamp} is the string ${RegExTimestamp}. This is because JMeter has yet to initialize that parameter
  5. By pressing “Step Over”, you will cause JMeter to initiate this JMeter variable and now the Evaluate tab will show the variable value (see image below)
  6. You can use the “Step Over” over and over and on each time, the debugger will reevaluate that string for you

JMeter Step by Step Debugger


Next Steps / On Our Roadmap

  • We are going to add a stop button so you won’t need to close the debugger to restart your debugging session.
  • We are also going to mark any variable which just changed in Bold so it will be easier to recognize which variable just changed.
  • Improving the breakpoints stop on scope (and not the sampler).
  • Keyboard shortcut to open the debugger (we will do our best :) ).

To conclude - the Step-by-Step debugger is a significant tool which every JMeter scripter should have in their toolbox. In addition to debugging your scripts, you can also understand how JMeter scoping works and see, for the first time, the execution order of your test plan.

IT DREAM (software)

Published at DZone with permission of Refael Botbol, DZone MVB. See the original article here.

Opinions expressed by DZone contributors are their own.

Related

  • Living in a World Without Neil Peart
  • The Rise of Shadow AI: When Innovation Outpaces Governance
  • React’s Unstoppable Rise: Why It’s Here to Stay
  • Process Mining Key Elements

Partner Resources

×

Comments

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: