RunAs Mode

Applies to TestComplete 15.46, last modified on January 09, 2023
Information in this topic applies to generic desktop applications (.NET, WPF, Delphi and others).

Using RunAs mode, you can launch and test your application under a different user account. This is similar to running the application using the Run As command of the application’s context menu in Windows Explorer, or using the runas command from the command prompt. Testing under different accounts helps you ensure that the application functions correctly under user accounts with different permission sets. For more information, see Testing Applications Running Under Another User Account.

Note: The RunAs mode is only supported for standalone applications added to the project using the Generic Windows application option in the Project Wizard, or the Add Application command in the TestedApps editor. It is not supported for Java, AIR, ClickOnce and web tested applications.

Requirements

  • Only accounts with non-empty passwords are supported.

  • The Secondary Logon service must be run in Windows.

  • TestComplete must be run with administrator privileges. See also Using TestComplete With Administrator Privileges.
  • Testing Open Applications in RunAs mode requires that the user account under which TestComplete is run has Default Access Permissions. See Settings for Testing Open Applications in RunAs Mode.

  • The tested application must be launched in the RunAs mode directly from TestComplete. Interaction with applications run from Windows Explorer or using the runas command may be slow.

Activating RunAs Mode

To activate the RunAs mode for a tested application:

  • Select the application in the TestedApps editor.

  • In the Basic Parameters section, select RunAs from the Run Mode combo box.

  • In the Run-Mode Parameters section, specify the user account under which you want to launch the application, and other parameters. See RunAs Mode Parameters.

  • Select File | Save from the main menu of TestComplete to save the changes.

From now on, when you launch the application from Project Explorer, from the TestedApps editor or from tests using the Run TestedApp keyword test operation or the TestedApps.AppName.Run scripting method, TestComplete will launch the application under the specified user account.

You can also activate the RunAs mode and specify its parameters from your keyword tests and scripts. To learn how to do this, see Editing Desktop Application Parameters.

RunAs Mode Parameters

You can view and change the tested application parameters, such as the application path and the user account, in the TestedApps editor. For a detailed description of available parameters, see:

RunAs Mode Parameters

See Also

About Tested Applications
Testing Applications Running Under Another User Account
Run Modes and Parameters
RunAs Mode Parameters

Highlight search results