If you are using Apache JMeter™ on a macOS machine, you probably encountered an annoying issue: double clicking on a JMeter JMX script doesn’t open JMeter GUI automatically! Instead, to open a JMX script in JMeter you have to open the terminal, navigate to your bin folder, run the /jmeter.sh command, click the ‘Open’ button in JMeter and choose your JMX script.
Luckily for all you Mac users, there is a way to automate this manual procedure, by using Apple’s Automator, The Automator is an OS X application that creates workflows for automating repetitive tasks into batches.
Here is how you can use Automator to automate the process of opening a JMX script in JMeter:
- Open the Automator on your Mac.
In the search field, search for Run Shell Script and double click on this option.
Replace the ‘cat’ in the shell script field to the full path for your JMeter executable file
Change the ‘Pass input’ on the top-right corner from ‘to stdin’ to ‘as arguments’.
Save the application and give it a name, for example ‘JMeter’.
Right click on a JMX script that you created, choose ‘Open With’ and select ‘Other..’.
- Select the new ‘JMeter’ application you created with Automator, check the ‘Always Open With’ checkbox and click on ‘Open’.
Right click on a JMX file and click on ‘Get Info’.
Make sure that the ‘Open With’ is set to JMeter, click on ‘Change All...’ and then click on ‘Continue’.