BuiltIn.RebootAndContinue Method

Applies to TestComplete 15.47, last modified on January 20, 2023
This method is obsolete. See the Remarks section below.

Description

You can use the RebootAndContinue method if you need to restart your computer during the testing and then continue the test execution with the specified script routine.

Declaration

BuiltIn.RebootAndContinue(ScriptProcName, Password, UserName, Domain)

ScriptProcName [in]    Required    String    
Password [in]    Optional    String Default value: Empty string   
UserName [in]    Optional    String Default value: Current user name   
Domain [in]    Optional    String Default value: Current user domain   
Result None

Applies To

The method is applied to the following object:

Parameters

The method has the following parameters:

ScriptProcName

Specifies the name of the script routine that will be executed after you have restarted the computer. If the script routine is declared in the same unit where RebootAndContinue is called, you can just specify the routine’s name. If the routine is declared in another unit, its name must be specified in the format unit_name.routine_name.

The routine must not use parameters. To pass information to it, you can either save the needed data to a temporary file, or use project or project suite variables (see Using Variables).

Password

Specifies the password used to log into the operating system after the restart. If the parameter is skipped, TestComplete will use an empty string. This parameter is obligatory if you want to continue test execution under another user account.

UserName

Specifies the account that will be used to log into the operating system after the restart. If you skip this parameter, the current account will be used.

Domain

Specifies the domain to which the user specified by the UserName parameter belongs. If you skip this parameter, TestComplete will use the domain that the current user belongs to.

Result Value

None.

Remarks

This method is obsolete. It is supported for backward compatibility only. To restart the computer and then continue the test execution, use the aqEnvironment.RebootAndContinue method.

After restart, the environment that TestComplete and the tested applications functions in, differs from the environment in which they functioned before the restart. So, script routines have to prepare the environment so that it matches the necessary conditions. For more information on how to do this, see Rebooting the Computer During Automated Testing.

To automatically log on after the restart, TestComplete stores the specified user name, password and domain to the Registry under the \\HKEY_USERS\{USER_SID}\Software\Microsoft\Windows\CurrentVersion\RunOnce key. TestComplete removes this data from the Registry once it has been launched after the restart. However, in some cases the logon parameters may remain in the Registry and they may be used when you restart the operating system. This happens if --

  • If the user account that is used for automatic login does not have permissions for changing the mentioned Registry keys.

  • If for some reason the TestComplete process is terminated before the data is removed.

Note that if the legal notice message is displayed upon logging in, TestComplete cannot close it. As a result, the test execution cannot continue after rebooting. To disable this message, assign blank values to the following Registry keys before starting your test:

  • HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon\LegalNoticeCaption
  • HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon\LegalNoticeText

Make sure you have correctly specified the user name, password and domain, especially if you want to log on under another user account. You should also check whether the following conditions are met:

  • The \\HKEY_USERS\{USER_SID}\Software\Microsoft\Windows\CurrentVersion\RunOnce Registry key exists for the user under whose account you want to log in after the restart.

If any of these conditions are not met, the login procedure will fail and the test will not be resumed.

To use the “reboot-and-continue” feature, TestComplete must be running with administrator privileges. See Using TestComplete With Administrator Privileges.

We would like to note once again that the script routine should not use parameters. To pass information to it, you can either save the needed data to a temporary file, or use project or project suite variables (see Using Variables).

See Also

RebootAndContinue Method
Rebooting the Computer During Automated Testing
Using Variables
Working With Files From Scripts

Highlight search results