Unable to navigate to the <my url here> page.
Unable to navigate to the <my url here> page.
How did you resolve this ?
We are running the tests on remote testexecute machines . Bu wen we disconnect the remote desktop then our tests . Test fails as soon as the firefox browser is launched .
We do have the problem when the Remote desktop window remain open.
@nisgupta , we did an admin hack where we set registry keys on Windows machine for auto admin login on restart, then reboot. At end of test, we ran script that unset those keys and rebooted to lock machine again.
This was done a very long time ago and we no longer use TestComplete, so not certain if will work still. Note that some of these script commands use project variables set up in TestComplete, so you will have to implement or substitute actual values.
Sub SetUpDailyRun ' Prepares for the automated test run by enabling auto-logon ' and setting a task to execute for TestComplete ' before rebooting the PC Dim regKey If aqEnvironment.IsPluginInstalled("Storages") = True And aqEnvironment.IsPluginInstalled("Win32API") = True And aqEnvironment.IsScriptExtensionInstalled("WMI Object") = True Then Set regKey = Storages.Registry("SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon", HKEY_LOCAL_MACHINE, getRegArch()) Call regKey.SetOption("AutoAdminLogon", "1") If regKey.GetOption("AutoAdminLogon", "<none>") <> "1" Then Log.Error "Failed to set ""AutoAdminLogon""." Call regKey.SetOption("AutoLogonCount", "1") If regKey.GetOption("AutoLogonCount", "<none>") <> "1" Then Log.Error "Failed to set ""AutoLogonCount""." Call regKey.SetOption("DefaultUserName", Project.Variables.WinUser) If regKey.GetOption("DefaultUserName", "<none>") <> Project.Variables.WinUser Then Log.Error "Failed to set ""DefaultUserName""." Call regKey.SetOption("DefaultPassword", Project.Variables.WinPassword) If regKey.GetOption("DefaultPassword", "<none>") <> Project.Variables.WinPassword Then Log.Error "Failed to set ""DefaultPassword""." Call regKey.SetOption("DefaultDomainName", Project.Variables.WinDomain) If regKey.GetOption("DefaultDomainName", "<none>") <> Project.Variables.WinDomain Then Log.Error "Failed to set ""DefaultDomainName""." Set regKey = Storages.Registry("SOFTWARE\Microsoft\Windows\CurrentVersion\RunOnce\", HKEY_LOCAL_MACHINE, getRegArch()) Call regKey.SetOption("TestCompleteTask", """" & aqFileSystem.IncludeTrailingBackSlash(Project.Path) & "task.vbs" & """") If regKey.GetOption("TestCompleteTask", "<none>") <> """" & aqFileSystem.IncludeTrailingBackSlash(Project.Path) & "task.vbs" & """" Then Log.Error "Failed to set ""TestCompleteTask""." ' This call stopped working in 06/2013 ' for running when user logged out 'Call Sys.Restart() Call WMI.RestartComputer() Else Log.Error "Required extensions are not installed.", "You must enable ""Storages"" Extension, ""Win32API"" Extension, and ""WMI"" Script Extension." End If End Sub 'SetUpDailyRun Sub CleanUpDailyRun ' Cleans up after an automated run by ' disabling auto-logon ' and deleting the TestComplete task ' before rebooting Dim regKey If aqEnvironment.IsPluginInstalled("Storages") = True And aqEnvironment.IsPluginInstalled("Win32API") = True Then Set regKey = Storages.Registry("SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon\", HKEY_LOCAL_MACHINE, getRegArch()) Call regKey.SetOption("AutoAdminLogon", "0") If regKey.GetOption("AutoAdminLogon", "<none>") <> "0" Then Log.Error "Failed to set ""AutoAdminLogon""." Call regKey.RemoveOption("AutoLogonCount") If regKey.GetOption("AutoLogonCount", "<none>") <> "<none>" Then Log.Error "Failed to delete ""AutoLogonCount""." Call regKey.RemoveOption("DefaultUserName") If regKey.GetOption("DefaultUserName", "<none>") <> "<none>" Then Log.Error "Failed to delete ""DefaultUserName""." Call regKey.RemoveOption("DefaultPassword") If regKey.GetOption("DefaultPassword", "<none>") <> "<none>" Then Log.Error "Failed to delete ""DefaultPassword""." Call regKey.RemoveOption("DefaultDomainName") If regKey.GetOption("DefaultDomainName", "<none>") <> "<none>" Then Log.Error "Failed to delete ""DefaultDomainName""." Set regKey = Storages.Registry("SOFTWARE\Microsoft\Windows\CurrentVersion\RunOnce\", HKEY_LOCAL_MACHINE, getRegArch()) Call regKey.RemoveOption("TestCompleteTask") If regKey.GetOption("TestCompleteTask", "<none>") <> "<none>" Then Log.Error "Failed to delete ""TestCompleteTask""." Call Sys.Restart() Else Log.Error "Required extensions are not installed.", "You must enable ""Storages"" Extension and ""Win32API"" Extension." End If End Sub 'CleanUpDailyRun Function getRegArch() ' Returns constant for registry architecture for use in Storages.Registry If Sys.OSInfo.Windows64bit = True Then getRegArch = AQRT_64_BIT Else getRegArch = AQRT_32_BIT End If End Function 'getRegArch
Thanks for sharing your solution with us, @rgratis
Forgot to mention above that the registry key edits also set the automation to run on reboot by entering a task script. I discovered that often tests were not running correctly when placed directly in the task.vbs file because the Windows desktop was not initializing. It turns out that the startup tasks placed in the registry must end before Windows continues startup.
I got around this by using task.vbs to call a second script. This way, the startup command for task.vbs completes very quickly. Windows finishes starting up after task.vbs is done. Meanwhile, the second script has a wait time in it to let Windows finish before running its own commands.
See task-sample.vbs for an example of calling another script. This will be "task.vbs". Then see task-script-sample.vbs for an idea of what complex things you can do in your second script. The name of this script does not matter, so long as you call it from task.vbs.
CC @nisgupta
User | Count |
---|---|
2 | |
1 | |
1 | |
1 | |
1 |
Subject | Author | Latest Post |
---|---|---|