Forum Discussion

g_kucharski's avatar
g_kucharski
Occasional Contributor
10 years ago

WaitWinFormsObject wait for project's Method invoke timeout instead its own



Hello,

I notices that in some cases WaitWinFormsObject pauses the test for project's Method invoke timeout instead for Method's Timeout.



I call the method as usual:



IF

Aliases.MyApp.WaitWinFormsObject("MyForm", 500).Exists then

...

end if



When there is no "MyForm" TestComplete freezes for 1min (I have project's Method invoke timeout Set for 60000ms) displaying 'waiting for WaitWinFormsObject("MyForm")'. I would expect rather 0,5s freeze.

The effect may be bound with CallObjectMethodAsync called just before:

1. I open a Form1 with CallObjectMethodAsync

2. Do some operations on Form1

3. I Close Form1, with CallObjectMethodAsync

4. As result of Form1.Close MyForm may appear. MyForm is modal and close method freezes test until MyForm is closed... that is why I have to use Async call for Form1.Close.

Did anyone experienced similar problem? Is there a workaround for it? Can project's Method invoke timeout be changed from script level perhaps?



regards

Greg


2 Replies

  • TanyaYatskovska's avatar
    TanyaYatskovska
    SmartBear Alumni (Retired)

    Hi Grzegorz,


     


    You've said that you observe this behavior only in certain cases. Can you identify the details that lead to this issue?


    As a rule, the Wait methods wait for the specified time until the object appears (500 ms in your case).


     

  • Ryan_Moran's avatar
    Ryan_Moran
    Valued Contributor
    When the parent object of your form (the process) does not exist Test Complete will wait the full timeout. You need to check that the process exists prior to checking if the form exists.