rgratisFrequent ContributorJoined 14 years ago93 Posts23 LikesLikes received4 SolutionsView All Badges
ContributionsMost RecentMost LikesSolutionsRe: Unable to navigate to page 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 Re: Unable to navigate to page 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 Java application objects not recognized, WaitSwingObject fails in method invoke timeout Having an intermittent issue with recognizing objects in our desktop Java application. Every so often, recognition of various top-level popup dialogs will fail. Note that it is not always the same test failing. Different tests will fail in different runs, with different dialogs. Symptoms are always the same. For example, looking for this object: Set object = Sys.Process("AppName").WaitSwingObject("JDialog", "Open Datafile(s)", 0) And it fails after an extended amount of time. Then, TestComplete logs an Unexpected window error for an object like this: Sys.Process("AppName").Window("SunAwtDialog", "Open Datafile(s)", 1) The amount of time WaitSwingObject takes to fail is directly linked to the project's Open Applications Method invoke timeout setting. I've tried increasing up to 15 minutes, and WaitSwingObject will take 15 minutes to return and fail. Seems the application is failing to respond to some internal method called in WaitSwingObject. I tried enabling Freeze Diagnostics for our application process with a lower value (2 minutes), but TestComplete never detected the freeze. Not certain how to gather more information. Re: Errors loading pages in Chrome The Chrome saga continues... A while ago, I switched to a neat method of monitoring page loads in Chrome that used the tooltip text to detect when the browser was loading (credit goes to Colin McCrae for coming up with that little gem). http://community.smartbear.com/t5/Functional-Web-Testing/contentDocument-readyState-always-quot-complete-quot-in-Chrome/td-p/89758 Unfortunately, this broke when the MSAA Description stopped returning any text. I talked to TestComplete tech support about it, but it looks as though Chrome just isn't providing that property on the objects any longer. There doesn't seem to be a way to access the tooltip text...? http://community.smartbear.com/t5/Functional-Web-Testing/Chrome-43-MSAA-Description-blank-wait-for-page-load-fails/m-p/100323#M24914 And using Page.Wait still fails miserably in the Chrome browser. So... circling back around to the original thread here to try to figure out how to get our automated tests working in Chrome again. Why, oh why, is it so difficult to tell me if the browser is loading a page? Re: Losing recognition of Java Swing objects during test run; top-level window becomes SunAwtFrame Ended up opening a support case. The solution was to increase the value of Project Properties > Open Applications > Method invoke timeout. My test scripts were accessing internal application methods, and the initial setting was 3000. When the application was working on a big file, it failed to respond within 3 seconds. This caused the Swing object recognition failures. I've increased the setting to 60000 in my projects for now, and this has gotten the test suite running again. Losing recognition of Java Swing objects during test run; top-level window becomes SunAwtFrame I've tried running our automated tests in TestComplete 11 for the first time, and the test run gets a few tests in and then fails all the remaining tests. After watching it a few times, I've realized that TestComplete is losing the ability to recognize the Java objects (SwingObject type) in our application after opening a particularly large file in the application. When the application starts, TestComplete correctly recognizes all the Swing objects. A few tests on smaller files are completed successfully. Then, a larger file is opened and at that point, TestComplete fails to recognize the application objects. I've attached a screenshot. Basically, the top-level Swing window recognition goes away and the window is only recognized as type Window("SunAwtFrame"). Any suggestions would be appreciated. SolvedRe: Chrome v. 44... I tried resetting the policy with no result. Appears to be an actual issue, as far as I can tell: https://code.google.com/p/chromium/issues/detail?id=512627 Re: Chrome v. 44... Thanks for the alternate method for disabling updates in Chrome, Alex. I had gone through and done the Group Policy setup to prevent updates, but it appears that after I manually updated to the very last release of 43, that version started ignoring the "no update" policy and updated itself to 44... As Tanya mentioned, Chrome 44 works with TestComplete 11 when the TC11 extension has been enabled (and chrome://flags/#enable-npapi is enabled). Tried copying the Chrome/Application/<version> folder to the desktop, uninstalled Chrome, and then ran <version>/Installer/setup.exe, but it did not appear to do anything. Chrome 43 MSAA Description blank; wait for page load fails For a while now, I've been waiting for Chrome processing to finish by waiting for the Reload button Description to become "Reload this page". For background on why this was done, see the following threads: contentDocument.readyState always "complete" in Chrome? Errors loading pages in Chrome Now, with Chrome 43, the Description property is blank. I can't seem to find a way to get the hover tooltip text for the Chrome toolbar buttons. Note that I have the toolbar set up for the Object Browser in Project Properties > Open Applications > MSAA by adding Chrome_WidgetWin_* to the window list. Does anyone have suggestions, either for getting the button tooltips or waiting for page processing in Chrome? Version info: Chrome 43.0.2357.81 m TestComplete 10.60.3387.7 (Edit: Chrome 43 patch installed.) OS: Windows 7 Re: Chrome 43 MSAA Description blank; wait for page load fails Yep, running with the latest Chrome patch too.