Automating MATLAB on Linux

Last edited on

Automation of MATLAB on Linux can be a bit tricky, because MATLAB does not behave like a regular Java Application.

For starters, you will need to configure the JRE used by MATLAB for Squish to use, like one would do for any other Java Application that should be automated for Squish.

After this, additional steps are needed:

MATLAB must be started with the -desktop argument to allow it to start its UI from a process that has no terminal, otherwise Squish will just sit there and hook the application based on the splash screen, but the real UI will never be shown.

The shell script provided below can be used for that. In this case the script must be used as the AUT:

run_matlab.sh

For example:

    startApplication("run_matlab.sh MATLAB_BIN_DIRECTORY")

(In this, MATLAB_BIN_DIRECTORY must be replaced with the path to the "bin" folder in the MATLAB installation folder.)

With this the required setup is done.

Notes