Forum Discussion

Poornimak79's avatar
Poornimak79
Occasional Contributor
5 years ago

Test Complete (14.20) hangs after waiting for Page ("*").

Hi All   Recently we have upgraded to 14.20 and while running the scripts that were recorded in 14.0  i see that the Test Complete is hanging.  i had to kill Test Complete and rerecord the scripts...
  • kevin_kapell's avatar
    kevin_kapell
    5 years ago
    function CloseBrowserProcess(BrowserProcess)
    {
      Log["Event"]("Starting function CloseBrowserProcess with the browser " + BrowserProcess);
      //This function is used to close a specific browser processes that may still be running after doing a close command
      var process;
      switch(BrowserProcess)
      {
        case "btIExplorer":
        case -1:
        case "iexplore":
          process = Sys.WaitProcess("iexplore",2000);
          break;
       
        case "btChrome":
        case -3:
        case "chrome":
          process = Sys.WaitProcess("chrome",2000);
          break;
        case "btFirefox":
        case -2:
        case "firefox":
          process = Sys.WaitProcess("firefox",2000);
          break;
        case "btEdge":
        case -6:
        case "edge":
          process = Sys.WaitProcess("edge",2000);
          break;
        default:
          Log["Warning"]("Browser process not identified. Value = " + BrowserProcess);
          return false;
      }
     
      if (process.Exists)
      {
        Log.Event("Closing browser");
        process.Close();
        aqUtils.Delay(1000,"Delay for browser to be closed");
        if(process.Exists)
        {
          Log.Event("Terminating browser");
          process["Terminate"]();
        }
      }
      else
      {
        Log.Event("The browser does not appear to be running.");
      }
    }