propertiesjmeterremovealljsr

How can I remove all properties in Jmeter after the run?


I usually set properties within the run in Jmeter. How can remove all these properties after the run without knowing their names?

I usually use props.remove() to remove only one specific property, but how can remove all?


Solution

  • Properties lifetime is limited by the JVM lifetime so it's enough to restart JMeter to remove any custom properties.

    Use props.clear() function in any of the JSR223 Test Elements (the syntax assumes Groovy language)

    Demo:

    enter image description here

    However if you want to keep original JMeter properties for whatever reason:

    enter image description here

    You can store them into and interim object (or to the file) somewhere in setUp Thread Group and restore it in the tearDown Thread Group