Forum Discussion

bistritapcv's avatar
bistritapcv
Contributor
5 years ago

timeout while waiting for a window (such as explorer, etc).

I have a main method in C# using Visual Studio. The important part is

 

     public void reprice() {

        ...

        try

        {

              test1();

       }

       catch(Exception ex)

       {

              System.Diagnostics.Debug.WriteLine("place a break point here");

       }

       ...

}

 

with the expectation that anything in test1() causing an exception I can catch.  test1() has my Test Complete (12) code in it.  The entire test worked fine.

 

A teeny subset:

 

pubclic void test1() 

{

    ...

    Connect.NameMapping["Sys"]["Keys"]("[Hold][Win]e[Release]");
    wndCabinetWClass = explorer["wndCabinetWClass"];

}

 

the second line beginning with wnd depends on the [Win]e above it top open a windows explorer window.

 

To simulate an error, I commented out the Connect line.  When I run it, I get the message

"waiting for the wndCabinetWClass...", which is exactly what I would expect.  The problem is, it does not seem to time out.  It gives the message, and when the dots get to the end, it starts over again, and never seems to timeout.

 

As you can see from the attached picture, my auto wait timeout is 10000 ms (10 sec), but this thing is still waiting after minutes.  It takes a while for some windows to come up, but I would think 60 seconds is good enough.

 

I found a suggestion to do "Options.Run.Timeout = 30000;", however my code cannot find Options.

So I am not sure what to do.  I guess it will eventually time out when the test has reached its maximum time, but that could be 30 minutes.

1 Reply

  • tristaanogre's avatar
    tristaanogre
    Esteemed Contributor

    Right... you're trying to access a TestComplete IDE object in a non-TestComplete environment.  I really am not sure what "Connect" does or is (I'm not a developer myself) but understand that running automation from Visual Studio IS supported by TestComplete, but you should run things in a different fashion.  See my comments in your other thread.