The supported environment variables in TestDriver are:

VariableTypeDescription
TD_SPEAKbooleanUse text to speech to hear TestDriver speak as commands are run. Helpful when you don’t use TD_OVERLAY and just plain fun.
TD_ANALYTICSbooleanSend analytics to TestDriver servers. This helps provide feedback to inform our roadmap.
TD_NOTIFYbooleanSend desktop notifications when commands are run.
TD_MINIMIZEbooleanWhen not using VMs, minimize the terminal window / calling app when running commands. Useful if you only have one monitor, you don’t want the terminal to show up.
TD_API_ROOTstringDeveloper only. Set API root to another URL. For on-prem.
TD_API_KEYstringSet this to spawn VMs with TestDriver Pro.
TD_OVERLAYbooleanSpawn overlay window that shows both the TestDriver console output, and draws the cursor and squares on the screen as TestDriver thinks. Defaults to true if not provided.
TD_VMbooleanRun commands in a Linux VM instead of on own desktop. Requires API key.
TD_VM_RESOLUTIONstringChange resolution when TD_VM is true. Format like 1280x1024.
TD_TYPEstringSet the type of test to run. Can be website, desktop, or mobile. Not required.

Always remember to add a .gitignore file to your repository including a .env line so you never accidentally commit you TestDriver API key. This is important for security and to prevent exposing sensitive information. For more info see GitHub Docs.


Example

TD_VM=true
TD_API_KEY=your_api_key
TD_VM_RESOLUTION=1024x768
TD_MINIMIZE=true
TD_TYPE=website
TD_WEBSITE=www.jeep.com
TD_ANALYTICS=true
TD_OVERLAY=false

In this example .env file, we’re running a website test in a local Linux VM with a resolution of 1024x768. The terminal will be minimized, and the overlay won’t be shown. Analytics will be sent to TestDriver servers.


Using environment variables in deployed tests

When running tests in a deployed environment, you can set environment variables in the env section of your GitHub Actions workflow file. This allows you to customize the behavior of TestDriver based on the environment in which it’s running. Setup any environment variables you plan to use in the deployed test in your .env file and add them as GitHub secrets.

For more info on how to set up environment variables with GitHub Actions, see Managing Secrets in GitHub Actions

In this example, there is both a TD_TEST_USERNAME and TD_TEST_PASSWORD variables in the local .env file. This file is used to run tests locally and mask credentials used to log in to a website. When deployed, these variables are stored as secrets in GitHub and are passed to the TestDriver action when it runs.


Example 2

TD_VM=false
TD_MINIMIZE=true
TD_WEBSITE=www.rollsroyce.com
TD_ANALYTICS=false
TD_OVERLAY=true
[email protected]
TD_TEST_PASSWORD=iwokeupinanewbugatti

In this example .env file, we’re running a website test with our desktop using the local agent. The terminal will be minimized, and the overlay will be shown. Analytics won’t be sent to TestDriver servers. The TD_TEST_USERNAME and TD_TEST_PASSWORD variables are used to log in to the website. Be sure to expand these in your test with ${TD_TEST_USERNAME} and ${TD_TEST_PASSWORD} notation!