Forum Discussion

Soumya's avatar
Soumya
Occasional Contributor
7 years ago

TestComplete window not minimizing causes Overlapping error

Hi,   I am automating a java swing application.  When I run the test, TestComplete window doesn't get minimized by itself. So it cannot search for the icon of my application. Hence it gives the e...
  • AlexKaras's avatar
    7 years ago

    Hi,

     

    > So it cannot search for the icon of my application.

    It can search, but cannot click on the found element because this element is overlapped by another one. Exactly like the human - you cannot click on some element if this element is overlapped.

     

    > Isn't it a defect on TestComplete?

    No, this is not a defect but correct and expected behavior: TestComplete has no idea of whether or not the target element must be visible and not overlapped. This is completely depends on your test and thus must be handled by your test code.

     

    > is there any other alternative ?

    a) Consider Tools|Current Project Options|Playback>Runtime>Minimize TestComplete option;

    b) It is a good practice to call .Activate() method for the top-level window. This method moves the target window on top of all windows on screen (like if you switch to this window via Alt-Tab). If the target window cannot be activated (for example, if it is blocked by some other modal window), then OnUnexpectedWindow event will be triggered making it possible for your code to handle unexpected blocking windows.