Forum Discussion

AMR013's avatar
AMR013
Contributor
10 months ago

TestComplete does not run script after browser launch even though Playback is still going on

I've been having this weird issue with TestComplete where after launching the browser, it just stops doing anything while the Playback is still technically occurring (Pause/Stop buttons appear in the top-right corner of the screen while it says 'Playback' below).

This problem does not occur all the time, but occurs frequently enough to where it can become an issue when running my scripts via jobs. Clicking the Pause button does nothing (Test is not paused - Status still says 'Playback'), while clicking the Stop button changes the Status to 'Stopping', but it doesn't actually stop the test; It just stays in the same state as it was when it was in 'Playback' status. In order to get out of this state, I have to force close TestComplete and then re-start, which typically results in playback to actually work next time I run my same script without any modifications made.

Would anyone have any idea what's going on? I'm not doing anything fancy with my script - Just launching the browser with my desired URL, and then attempting to log in. It just decides to "freeze" after the browser launches. I wish I had logs to provide, but with the issue I'm facing I can't even see why it's doing what it's doing. Below are examples of my code lines (Not doing anything special as you can probably see - I do want to note that this happens with any browser I decide to use, not just Edge):

  br = Browsers.Item(btEdge);

  br.RunOptions = '<insert URL here>';

  br.Run();

/* Below would be code of running my application. Application would freeze after the URL is launched. */

Any help would be appreciated. Thanks in advance.

  • rraghvani's avatar
    rraghvani
    Champion Level 3

    What RunOptions have you provided?

    What version of TC are you using?

    Assuming there's no other Chrome browsers running, this should work without issues,

    function Test()
    {
        Browsers.Item(btChrome).Run("https://www.w3schools.com/howto/tryit.asp?filename=tryhow_html_file_upload_button");
        var browser = Sys.Browser("chrome");
        var page = browser.Page("*");
        
        var button = page.FindElement("#iframeResult").FindElement("#myFile");
        Sys.HighlightObject(button);
        
        var submit = page.FindElement("#iframeResult").FindElement("//input[@type='submit']");    
        Sys.HighlightObject(submit);
    
        Sys.Browser("chrome").Close();
    }

    It launches the website, and highlights the buttons, then closes the Chrome browser.

    • AMR013's avatar
      AMR013
      Contributor

      Hi rraghvani

      In my RunOptions line, I only provided the URL of the website I want to access. 

      Regarding my TestComplete version, I'm currently on 15.61.48.7.

      • rraghvani's avatar
        rraghvani
        Champion Level 3

        I've edited my response. Have a look at the code example I've attached.

  • rraghvani

    I believe I figured out what's causing my scripts to occasionally not run. After the browser is closed (Using Google Chrome Version 123.0.6312.105), I noticed this process is still up: TestComplete Chrome Host (32 bit). If it's still up, that's when my script hangs. If I terminate it, my script runs fine. Any reason why this isn't closed when Chrome is closed?