Forum Discussion

royd's avatar
royd
Regular Contributor
8 years ago

Since this morning getting "Microsoft JScript runtime error.", never encountered before!

Using TestComplete 12.2, Windows 7, JScript.

 

Since I have started using (for about 3+ months) the following, I have never had any errors. Ran the same script yesterday without any trouble!

 

while (Sys.WaitBrowser("iexplore").Exists)
    {
      // if browser open
      Sys.WaitBrowser("iexplore").Close(500);
    }

 

This morning started to have "Microsoft JScript runtime error. Object doesn't support this property or method" error at the

while (Sys.WaitBrowser("iexplore").Exists)

!

 

Tried several script routines, same error!

 

Desperately need help solving the issue.

 

Dave

  • AlexKaras's avatar
    AlexKaras
    Champion Level 3

    Hi Dave,

     

    Have you tried to execute this loop step-by-step under debugger in TestComplete and check whether the problem persists?

    My current understanding is that:

    -- There was IE browser running in the system;

    -- The loop found it on the first pass and proceeded to .Close() statement;

    -- The browser was commanded to close and TestComplete waited for 0.5 sec for the browser process to end;

    -- 0.5 sec was not enough for the browser to close thus the second loop pass still found the process and proceeded to .Close() statement;

    -- By the moment of actual execution of the .Close() method IE process has ended. This invalidated the reference to the browser process and caused the error.

     

    As a quick fix attempt try to increase the parameter of the .Close() method from 500 to, say, 2500 and check if it helps.

    • royd's avatar
      royd
      Regular Contributor

      Hi Alex

       

      Thanks for your prompt reply. I will give it a try and report ASAP.

       

      Dave

      • royd's avatar
        royd
        Regular Contributor

        Just ran it, it got stuck the first time on line 19, did not make it to 21. See capture.

         

        Thanks.

         

        Dave