There are three separate environments that must be considered when testing AUTs:
- The squishrunner environment where test scripts are executed.
- The squishserver's environment.
- The AUT's environment (in which some Squish code also runs).
For AUTs started with ApplicationContext startApplication(autName), we can easily add environment variables in the Test Suite Settings view's Environment section. In addition, the squishserver sets some environment variables that are visible to the AUT. For more information, see Setting Environment Variables.
You can set the following environment variables to change the behavior of start*aut, squishserver, squishrunner and Squish IDE.
SQUISH_DUMP_FILE_PATH– This is read in the AUT's, squishrunner's and squishserver's environment on the Windows platform. When set the value defines where Squish stores dumps from crashed processes (its own as well as AUT processes). The default value for this variable points to a directory named SquishDumps in the users temporary files directory.
SQUISH_DUMP_FILE_USE_MSGBOX– This is read in the AUT's, squishrunners and squishserver's environment on the Windows platform. If set to 1 (the default value) Squish will show a dialog when it detects a crash in one of its own processes or the AUT process indicating where to a find a dump file from the crash which can be used to obtain further details. When being set to 0 Squish will not show a dialog, but instead print a message to the output of the process with the path to the dump file that has been generated. It is advised to set this environment variable to 0 for automated execution of Squish tests as the dialog will block further execution of tests.
SQUISH_LIBQTDIR– This is read in the AUT's environment by the Squish hooking code and by squishserver for Qt-based AUTs. If set, Squish will look in the directory specified by this variable for the Qt library during AUT startup and hooking.
SQUISH_LIBQTDIRis deprecated. Since Qt 5, this variable only works on Windows. Use
DYLD_FRAMEWORK_PATHon MacOS, or the
PATHon Windows to help the OS find Qt libraries, in the case where they are not being found by Squish during AUT startup.
SQUISH_LICENSEKEY_DIR– This is read by squishrunner and (indirectly) by Squish IDE. If set, Squish will look in the directory specified by this variable when looking for the Squish license key file; otherwise the key will be looked for in
$HOMEon Unix-like systems and in
%HOMEPATH%isn't defined) on Windows systems.
SQUISH_PREFIX– This variable is set by squishrunner before the script engine is started, and it is also set by squishserver before the AUT is started. This variable can be used to find the installation directory of Squish from test cases, as well as from the AUT.
SQUISH_QML_EXTENSION_PATH– This is read in the AUT's environment by the Squish hooking code for Qt-based AUTs. If set, Squish will look for QtQuick 1.x QML extensions in the directory specified by this variable in addition to the standard extension directory. See Installing QML Extensions.
SQUISH_QTQUICK_EXTENSION_PATH– This is read in the AUT's environment by the Squish hooking code for Qt-based AUTs. If set, Squish will look for QtQuick 2.x extensions in the directory specified by this variable in addition to the standard extension directory. See Installing QML Extensions.
SQUISH_SCRIPT_DIR– This is read by the squishrunner and the Squish IDE. The latter adds the paths contained in this environment variable to the Global Scripts view.
If set, in addition to looking in the test case's scripts directory and in the test suite's shared scripts directory, Squish will also search the directories listed in this variable when trying to locate a script file. The search also includes the paths listed in the
paths.inifile - which will be tried before those in this environment variable; see Initialization Files and the String findFile(where, filename) function.
SQUISH_DLLPRELOAD_DISABLE– This is read by squishserver for Qt-based AUTs on Windows. If set to
1, the dllpreload program will not inject any code into the AUT process but rather start it right away, i.e. dllpreload merely executes the given command line but provides no extra functionality.
This can be useful in complex test scenarios involving various scripts to launch tests and it's desirable to disable the functionality provided by dllpreload in certain cases without modifying the launcher scripts.
SQUISH_SHELL_ORIG_LD_LIBRARY_PATH– On Linux systems,
LD_LIBRARY_PATHvariable is modified by squishrunner and squishserver to help Squish find libraries. The original value of this variable is available here.
SQUISH_SHELL_ORIG_PATH– on Windows, the
PATHvariable is modified by squishrunner and squishserver to help Squish find DLLs. The original value of this variable can be found here.
SQUISH_TRANSLATION_AWARE_LOOKUP– This is read by Squish when testing Qt AUTs. If set to 1 Squish will attempt to do reverse translations when matching AUT object properties. See How to Test Internationalized Qt AUTs .
SQUISH_USE_SWT– This is read in the AUT's environment by the Squish hooking code for Java SWT-based AUTs. This can be set to
1on macOS systems being used to test Java SWT AUTs. Not needed for any recent Eclipse/RCP based application, which have the for SWT required -XstartOnFirstThread option in their
SQUISH_USER_SETTINGS_DIR– This is read in the AUT's environment by the Squish hooking code, by squishrunner, and by squishserver. If set, Squish will use this directory to load and store its user settings, instead of the default location. On Windows, this is
%APPDATA%\froglogic\Squish, and on Unix-like systems (Linux, macOS, etc.), it is
SQUISH_WRAPPER_PATH– This is read by the squishserver. If set, in addition to searching all the paths in the AUT Paths list, Squish will also search all the paths listed in this variable when trying to locate a wrapper library. For more information about the AUT Path, see AUT Paths and Mapped AUTs.
SQUISHIDE_TOOLS_PACKAGE_DIRECTORY- Sets the directory that the Squish IDE should use for the Squish command line tools. This variable is an alternative to the command line argument
-toolsPackage. See also Command line reference for Squish IDE.
Test scripts can access environment variables using the scripting-language-specific technique. For example, in Python, we can use
home = os.environ["HOME"] (having done
var home = OS.getenv("HOME");. Test scripts can also access the AUT's environment by retrieving an
ApplicationContext object and using the String applicationContext.environmentVariable(name) function; see Application Context.
Squish also supports other environment variables, but unlike those shown above—which must be set before Squish is run (for example, by using a shell script or batch file to set them and then to run the Squish IDE)—the other environment variables can be set inside Squish using the Test Suite Settings view's Environment section; see Setting Environment Variables for the AUT for more details.
© 2023 The Qt Company Ltd.
Documentation contributions included herein are the copyrights of
their respective owners.
The documentation provided herein is licensed under the terms of the GNU Free Documentation License version 1.3 as published by the Free Software Foundation.
Qt and respective logos are trademarks of The Qt Company Ltd. in Finland and/or other countries worldwide. All other trademarks are property of their respective owners.