7.5. Environment Variables

There are three separate environments that must be considered when testing AUTs:

For AUTs started with startApplication, we can easily add environment variables in the Test Suite Settings view (Section 8.2.16)'s Environment section. In addition, the squishserver sets some environment variables that are visible to the AUT; for more about these see Setting Environment Variables (Section 7.3.3).

On the command-line, for attachable AUTs started with start*aut, or for squishserver and squishrunner, we can set the environment variables that influence them before running them.

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 import os at the top of our script), and in JavaScript we can use var home = OS.getenv("HOME");. Test scripts can also access the AUT's environment by retrieving an ApplicationContext object and using the applicationContext.environmentVariable function; see Application Context (Section 6.3.12).

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 (Section 8.2.16)'s Environment section; see Setting Environment Variables for the AUT (Section for more details.