Scheduling Automated Tests

Applies to TestComplete 15.31, last modified on March 17, 2022

You can schedule automated tests to run daily or nightly using Windows Task Scheduler with the TestComplete command-line or SessionCreator arguments.

Use the TestComplete command line when you have an open interactive user session on your tested machine (basically, it means that you are logged in on it). In cases when the open user session is not possible for you, use the TestComplete SessionCreator utility.

Prerequisites for running tests on Windows 8.1 and later

If you are not going to test Windows Store applications, disable the support for Windows Store applications in TestComplete. To do this, select Tools > Options > Engines from the TestComplete main menu and then clear the Enable support for testing Windows Store applications check box.

Otherwise, to be able to test Windows Store applications, keep the support enabled and create an external script that will run TestComplete. To learn how to do it, see the instructions below.

Create a scheduled task

  1. In your Windows operating system, open the Control Panel. The way you do this depends on the Windows version you use. For example:

    • Windows 10: In the search box on the taskbar, type control panel, and then click Control Panel.

    • Windows 8.1: Move the mouse to the top right corner of the screen to open the Charms bar, then click Search and search for control panel.

    • Windows 7: Click Windows Start button > Control Panel.

  2. In the search box of the Control Panel (in the top right corner), type schedule and then select Schedule tasks. This will open the Task Scheduler window.

  3. Click Create task in the Actions panel on the right to create a new scheduled task. This will open the Create Task wizard.

  4. Use the wizard to specify the task properties like name, time, user account and others.

  5. In the Security Options group, select Run only when user is logged on.

  6. Specify the instructions that will launch TestComplete:

    On Windows 8.1 and later:

    Testing non-Windows Store applications.

    See instructions

    To test Windows Store applications:

    See instructions

    On Windows 7:

    See instructions

Notes

  • For a description of the TestComplete command-line arguments, see TestComplete Command Line.

  • Use TestComplete exit codes to determine if the test run was successful. If you need to check whether the test was successful, you can create a batch file which will call TestComplete, specify command-line arguments for it and check the TestComplete exit code. You can find an example for this batch file in the TestComplete Exit Codes topic.

  • Enable the Run only when user is logged on option for scheduled tests. These tests cannot be run with the Run whether user is logged on or not option selected, because in this case, they run in a non-interactive session and cannot interact with the GUI.

    Note that if you enabled the Run only when user is logged on option for a scheduled task, the computer must NOT be locked at the moment the task is triggered.

  • If you use Remote Desktop to connect to the computer where tests are scheduled, you need to disconnect from it using the tscon command. If you simply close Remote Desktop instead of using tscon, the remote computer will become locked and the scheduled GUI tests will fail.

See Also

Running Tests
TestComplete Command Line
TestComplete Exit Codes

Highlight search results