Forum Discussion

paulvinders's avatar
8 years ago

WaitWindow returns with a window object but the underlying window-tree is not complete



we wait for a modal window and perform an action:


var form = Sys.Process("abc").WaitWindow("TClass", "Title", -1, -1);

if (form.Exists)




Sometimes, WaitWindow returns, the form is visible, but form.Exists is false!?!

Often, WaitWindow returns, the form is visible, form.Exists is true, but form.panel waits until timeout occurs.

We work with TC11 and these problems never occured under TC9. Auto-Wait-Timout = 600000 but does not help.

Sources are written with JScript.


Looks like the Object-Tree is not totally mapped when we perform the form.panel-Statement.

Can anyone help?



P. Vinders


1 Reply

  • tristaanogre's avatar
    Esteemed Contributor

    Sounds like you have a multi step process to work through. You need to check for the initial Window itself... once it shows up, there is apparently additional processing that is being done and so you need to wait for that information to be completed.

    I'm not sure why you're getting the form.Exists as false initially... my guess is, perhaps, that the Group Index (the second parameter in WaitWindow) needs to be more specific. You are specifying, with the -1, that you want TC to disregard the group index. It is possible, then, that there are other windows with the same WndClass and WndCaption that are being created.

    Question: Is there a reason why you are not using NameMapping and Aliases for working with these objects? You can more granularly define and and detect objects using those tools rather than being dependent upon the more generic designations in WaitWindow.

    As to why it works in TC9 and not TC11, can't answer that.