Ask a Question

Event handler doesn't triggered when my unexpected window appears

New Contributor

Event handler doesn't triggered when my unexpected window appears

Dear Community!


I'm struggling for a while with my issue, looking for some solution in former discussions.

In my test project sometimes a kind of unexpected window appears during test run.

In some cases it's easy to handle the situation by adding some extra lines to the scripts, which checks for the existance of that window. I mean, i have this window mapped in TesComplete Namemapping, and checking the .Exists() property, and do the necessary steps.


But it's not so effective, having this high amount of mostly unnecessary waste of time.


I tried to set up an event handler, followed the steps, described in manual for OnUnexpectedWindow event. I added a script, which should handle the event.

But, what i see, testcomplete never calls this event handler, only exits with error attached in the picture.


Is there any reason of this, or is there any additional parameter setting which i may have missed?


Thank you all in advance,


Champion Level 3

Post a screenshot of your event handler code please.  It's almost impossible for us to tell what is happening from just an error message.

Dear Marsha_R!


I didn't attach eventhandler code, because testcomplete never hit the eventhandler script.

The attached error message shows the point, when testcomplete should call the eventhandler, but for me it seems like, the engine doesn't recognise it's an unexpected window event, only that the tested window is disabled.

Additionally i followed the setting steps of event handling described like in the related section on this page:




Champion Level 3

Then let's see the code from the "keyboard input" line on down to where the error happens.  

Showing results for 
Search instead for 
Did you mean: