Forum Discussion

budiaraf_ex's avatar
budiaraf_ex
Occasional Contributor
10 years ago

TestComplete not recognizing Visible windows

Hello



I'm having some trouble with TC not finding the proper dialogs and thinking they are invisible (Swing App). In the application, I have set the ID properties of my swing dialog to "AWTComponentName" and "Visible", which is always set to "true".



In my test, a window is opened and closed, but sometimes not disposed of and left floating. So, when playback opens the dialog again, the "floating" invisible one is still a process, leaving me with multiples of the same dialog.



Now, although this happens, I assume TC should find the dialog with the Visible=true property rather than throwing an error that the dialog it's looking for is invisible.



Is my logic wrong or am I missing something completely?



Thanks.

2 Replies

  • Marsha_R's avatar
    Marsha_R
    Champion Level 3
    Your logic is good but sometimes logic doesn't help with TC.  :)



    If you can find a way to totally close that invisible window, I would recommend that.  The less ambiguity the better.



    Alternatively, look for an index or some other third property that would be unique between the two instances of the window and use that in addition to Visible.  We started testing on an old version of Windows and found that every little popup we got when saving a file is called "Save As", and they were all visible at the same time, even though only the top one was actually accessible.   We ended up using an index to get to the right one at the right time.
  • budiaraf_ex's avatar
    budiaraf_ex
    Occasional Contributor
    Thanks for the answer Marsha.



    I agree that closing those extra windows would be ideal, but our application is so big at this point that it would be unreasonable and unrealistic to try to catch all the instances of this happening.



    I find that I can get around this by calling Sys.Refresh() and then some_dialog.RefreshMappingInfo() just before some_dialog gets used, but this solution is not at all ideal as this adds an extra manual step to the automated testing procedure (QA has requested we keep to keyword tests).



    I don't think the index would work for us as we are working with short, incremental tests and can't guarantee the order the tests will be executed. Windows might appear before their index.



    At this point I'm wondering/looking into if there is some way we can write a script to call those two methods before each step, or set of steps in a keyword test.