GlorianChris
GlorianChris

Reputation: 227

JMeter: how can I disable a View Results Tree element from the command line?

I have a number of tests that all have the View Results Tree element in them.

They are very useful in creating and debugging the tests, however inevitably some of the tests are saved with them enabled.

When the tests are run (from the command line), the ones with this element enabled blow out the JVM memory requirements hugely causing memory issues on the host (it runs many of these at the same time).

Is there any way to disable this particular element from the command line?

Upvotes: 4

Views: 2275

Answers (2)

GlorianChris
GlorianChris

Reputation: 227

One way I've found is to programmatically disable this component in the file: Changing

<ResultCollector guiclass="ViewResultsFullVisualizer" testclass="ResultCollector" testname="View Results Tree" enabled="true">

to

<ResultCollector guiclass="ViewResultsFullVisualizer" testclass="ResultCollector" testname="View Results Tree" enabled="false">

Using this command:

sed -i 's/View Results Tree\" enabled=\"true\"/View Results Tree\" enabled=\"false\"/' <test file.jmx>

Upvotes: 1

Dmitri T
Dmitri T

Reputation: 168122

The easiest way is running your test using Taurus tool which supports JMeter via JMeter Executor

Check out Modifications for Existing Scripts section for the details on how you can override some settings during running JMeter tests. The minimal working Taurus configuration file will be something like:

execution:
  scenario:
    script: /path/to/your/test.jmx
    modifications:
      disable: View Results Tree

JMeter-only solution would be forgetting about using the listeners, in case if you need to perform debugging you can temporarily add the next lines to user.properties file (located under "bin" folder of your JMeter installation)

jmeter.save.saveservice.output_format=xml
jmeter.save.saveservice.response_data=true
jmeter.save.saveservice.samplerData=true
jmeter.save.saveservice.requestHeaders=true
jmeter.save.saveservice.url=true
jmeter.save.saveservice.responseHeaders=true

The properties can also be passed via -J command-line argument like:

jmeter -Jjmeter.save.saveservice.output_format=xml -Jjmeter.save.saveservice.response_data=true .....

See Apache JMeter Properties Customization Guide for details on precise controlling your JMeter instance using properties overrides.

Upvotes: 1

Related Questions