1. Undo/Redo

It’s really annoying when a basic feature as undo / redo is not found in JMeter (from version 2.11 or earlier). Even until this feature appearing on version 2.12, there are not many people known of its existence. Or that there will be somebody noticed the 2 button undo / redo on the icon toolbar, but will not know how to use it.

Undo-Redo-Disable.png

Because this feature is disabled by default. It can be a long story involving technical issues or performance issue of the tool, but let’s shelve this issue aside. Please pay attention on how to enable and use this feature.

Firstly, under /JMETER_HOME/bin folder, open the jmeter.properties file in text editor mode. Then search this keyword undo.history.size, you’ll see these lines:

# Number of items in undo history
# Feature is disabled by default (0) due to known and not fixed bugs:
# https://bz.apache.org/bugzilla/show_bug.cgi?id=57043
# https://bz.apache.org/bugzilla/show_bug.cgi?id=57039
# https://bz.apache.org/bugzilla/show_bug.cgi?id=57040
# Set it to a number > 0 (25 can be a good default)
# The bigger it is, the more it consumes memory
#undo.history.size=0

Next, uncomment the property undo.history.size by removing sharp character # and set a number. And what does the number mean? It represents the maximum number of steps which you wanna undo/redo. For example undo.history.size=10, it means you can undo up to 10 steps previously.

undo.history.size=10

The number must be an integer (> 0). You might think you’ll set this to a large number, eg. 50 or 100, so you can undo many times as you want. But it’s wrong, you can see in the description above, it shows Set it to a number > 0 (25 can be a good default). So 25 is a suggestion number. But believe me, when you try to undo more than 5-10 steps at a time, you’ll be noticed big slowdowns of JMeter. Therefore, 10 is a better number in my perspective if you have a strong computer (or 5 is enough). Just use this feature in case you do a mistake and don’t use it as the common feature like Word.

Note: One more thing: Ctrl + Z or Command + Z (MAC) will not work for this case. Only clicking the undo/redo button in the toolbar.

Finally, save the file and restart JMeter, to something and see how it apply:

Undo-Redo-Enable.png

2. Automated Backups

A good news in JMeter 3.0, the feature Automated Backups of .jmx file is enabled when a test plan is saved. You don’t need to setup anything.

By default:

  • Backup history is enabled
  • Directory of backup files is ${JMETER_HOME}/backups
  • No expiration time is set which means we keep backups for ever.
  • Maximum 10 backups will be preserved.

However, you can change these configs by yourself. Under /JMETER_HOME/bin folder, open the jmeter.properties file in text editor mode. Then search this keyword JMX Backup configuration, you’ll see these lines:


#---------------------------------------------------------------------------
# JMX Backup configuration
#---------------------------------------------------------------------------
#Enable auto backups of the .jmx file when a test plan is saved.
#When enabled, before the .jmx is saved, it will be backed up to the directory pointed
#by the jmeter.gui.action.save.backup_directory property (see below). Backup file names are built
#after the jmx file being saved. For example, saving test-plan.jmx will create a test-plan-000012.jmx
#in the backup directory provided that the last created backup file is test-plan-000011.jmx.
#Default value is true indicating that auto backups are enabled
#jmeter.gui.action.save.backup_on_save=true

#Set the backup directory path where JMX backups will be created upon save in the GUI.
#If not set (what it defaults to) then backup files will be created in
#a sub-directory of the JMeter base installation. The default directory is ${JMETER_HOME}/backups
#If set and the directory does not exist, it will be created.
#jmeter.gui.action.save.backup_directory=

#Set the maximum time (in hours) that backup files should be preserved since the save time.
#By default no expiration time is set which means we keep backups for ever.
#jmeter.gui.action.save.keep_backup_max_hours=0

#Set the maximum number of backup files that should be preserved. By default 10 backups will be preserved.
#Setting this to zero will cause the backups to not being deleted (unless keep_backup_max_hours is set to a non zero value)
#jmeter.gui.action.save.keep_backup_max_count=10

I think the description above is clear enough for you to do what you want. Just uncomment the properties and set the corresponding number as your expectation, for example:

jmeter.gui.action.save.backup_on_save=true
jmeter.gui.action.save.backup_directory=/Users/user/Desktop/MyBackup
jmeter.gui.action.save.keep_backup_max_hours=0
jmeter.gui.action.save.keep_backup_max_count=50

And this is how the file is backed-up (every saving file):

back-up

This would prevent anyone to lose work anymore…

Advertisements