Forum Discussion

Muts's avatar
Muts
New Contributor
7 years ago

Chrome - Unable to navigate

I have script that closes all browsers, opens Chrome and then navigates to a URL;

 

while (Sys.FindChild("ObjectType", "Browser").Exists) {
  Log.Message("Found a browser calling Terminate");
  Sys.FindChild("ObjectType", "Browser").Terminate();

  Sys.Refresh();
}

 

Browsers.Item(btChrome).RunOptions = "--incognito --disable-session-crashed-bubble --disable-infobars --disable-password-generation --clear-token-service --ignore-autocomplete-off-autofill";
Browsers.Item(btChrome).Run();

 

OpenBrowser("Chrome");
Sys.Browser().BrowserWindow(0).Maximize();
Browsers.CurrentBrowser.Navigate("https://url.to.where.I.go", -1);

 

Browsers get closed nicely, Chrome is opened nicely and maximizes.  However the Navigate url results in the Browser and not doing anything and the TC monitor shows "Waiting for page('*')".

 

When it gets like that I have to kill TestComplete (closing makes it hang) and then in Task Manager kill all related processes.

 

What is causing that?  Why does TC decide randomly to not navigate to the URL?

 

4 Replies

  • AlexKaras's avatar
    AlexKaras
    Champion Level 3

    Hi,

     

    First question: what are versions of TestComplete and Chrome ?

     

    > Why does TC decide randomly to not navigate to the URL?

    Does it happen really randomly or every time?

    If it happens randomly, then (depending on your answer to the first question) I would say that previous instance of Chrome was not shut down completely, TestComplete got its instance and tries to wait for the page been opened in this 'incorrect' process.

     

    • Muts's avatar
      Muts
      New Contributor

      Hi,

       

      It is totally random.  Sometimes it occurs when executing directly after a reboot.  My 'workaround' is to kill all TC related processes in Task Manager and the relaunch TC.  After 2 or 3 cycles of this, TC eventually starts navigating OK.

       

      TC Version: 12.42.3048.7 x64

      Chrome: 64.0.3282.140 x64

       

      Chrome instances are being terminated fully prior to opening. Also, the times directly after a reboot (where TC and the execution of the test is run as the first thing; no other program or Chrome run prior) have no Chrome beforehand.

       

      Please see the code snippet in OP.

       

      • AlexKaras's avatar
        AlexKaras
        Champion Level 3

        Hi,

         

        Out of curiosity...
        TC12.40 and up installs two flavors: 32-bit and 64-bit, but the installer creates a shortcut for 64-bit flavor only. What if you try TC 32-bit located in <TestComplete>\Bin\ folder ? Does the same problem exist with TC 32-bit ?

  • These replies have been moved.