Five Quick JMeter Workarounds

Prateek Dua
3 min readNov 26, 2021

Sharing some meteoric JMeter techniques implemented from my end while handling multiple projects having different asks & problems to dealt with. Would be helpful to anyone further in case if required or stuck in middle as I :-)

1.[ Case ] : Run ‘setUp Thread Group’ once to generate value of some variable and pass it to 2nd ‘ Thread Group’.

< Solution> : Add ‘BeanShell Assertion’ under ‘setUp Thread Group’ and write single line in ‘Script ${__setProperty(oauthToken,${oauthToken})} . Here left param is varname mentioned to hold value of right param. Right param’s value got fetched earlier from regular expression /JSON extractor OR via JSR223 Post Processor. Now to use variable from ‘setUp Thread Group’ for APIs in 2nd thread group, mention ${__property(oauthToken)} wherever you want to call the required variable.

Setup Thread Group & Basic Thread Group

2. [ Case ] : JSON path of any API not getting identified (required to fetch dynamic value)on giving correct sequence of array/object too using scripting.

< Solution> : Simply use JSON Extractor to fetch the value from required path.

3. [ Case ] :Fetch value from child JSON which is dependent further on parent JSON and parent too have some dependency on child JSON to get fetched first. But some required part from parent JSON have been already stored in a JMeter variable while handling dynamic value for an earlier API.

< Solution> Use combination of JSON path + JMeter variable using JSON Extractor. E.g. cdata.combined_sku_map.${paxdata_reprice}.PayMode. Here ‘${paxdata_reprice}’ is JMeter variable holding value of parent JSON.

JSon Extractor

4. [ Case ] : JMeter native html dashboard output report is not giving satisfactory accurate results for load incremented scenario.

< Solution > Open JMeter directory/ bin folder — find below listed line in ‘user.properties’ file. jmeter.reportgenerator.statistic_window=20000. Change default value to -1. jmeter.reportgenerator.statistic_window=-1

JMeter Dashboard Reporting

5. [ Case ] Dumping accurate & correct data to any open-source time series database (say influxdb)from JMeter for further Grafana Dashboard plotting.

< Solution > AddBackend Listener’ component and select rocks.nt.apm.jmeter.JMeterInfluxDBBackendListenerClient as implementation selection.

Backend Listener

Thank You for Your Time & Patience in reading this out.

--

--