Undo and Redo are the very basic feature of any Editor or any IDE. It is really annoying that if such a basic feature is not found in JMeter. Here is the catch. JMeter has this feature but not by default and therefore we have to enable it from our end. JMeter team believes in making JMeter as light as possible and they are avoiding extra memory consumption that JMeter can take and hence Undo and Redo options are kept hidden or disabled by default.
Initially, the JMeter toolbar without Undo and Redo button looks like:
Follow the below steps to enable these options:
- Navigate to “bin” folder of JMeter directory
- Open “jmeter.properties” file using Notepad or Notepad++
- Search for “undo.history.size”
- Uncomment the line “undo.history.size=0” by removing # (sharp sign)
- Set a natural number as a value of “undo.history.size” attribute e.g. 1, 5, 10, 50 etc. (This number represents the maximum number of steps that you can undo or redo.)
- Save the file “jmeter.properties” and relaunch JMeter to reflect the changes.
Remember: The number must be a natural number (1,2,3,….n) or simply say positive integer other than 0. The suggested value by JMeter is 25 which you can see in the description above this line in “jmeter.properties” file, it shows “Set it to a number > 0 (25 can be a good default)”. So, you can give 1 or 5 or 7 or 10 or 12 or 15 or 25, but not Zero. If you give Zero, there will not be any changes.
This number represents the maximum number of steps that you can undo or redo. You can set this to a larger number e.g. 50 or 100 but the bigger it is, the more it consumes memory. When you try to undo/redo more than 5-10 steps at a time then you will notice a big slowdown in JMeter. Hence, JMeter team suggest to have a maximum value of 25 and that too for a computer with very high RAM memory. For most of the normal users, 5 or 7 solve their purpose. Here, I have given the value as 5 which shown above.
Once you restart the JMeter you can see Undo and Redo options in the JMeter toolbar which are greyed-out; indicate no action done yet.
Now, perform some actions in JMeter so that both the buttons get colourfully visible and clickable, as illustrated below:
Limitation: Ctrl + Z or Command + Z (in Mac OS) does not work in JMeter. Only clicking the Undo/Redo button in the toolbar works.
You can also do Undo/Redo from “Edit” option of the JMeter (Figure 05) or “Context Menu” by right-clicking on any of the Element (Figure 06), as illustrated below:
You may be interested: