Forum Discussion

Morgan's avatar
Morgan
Frequent Contributor
13 years ago

Unexpected window not logging error

I have an application window that in TC8 is not logging an error in the log.  I am trying to figure out why that is.  I have made adjustments to the On Unexpected Window settings on the Playback properties (unchecked all that appear there) as well as unchecked the option to Ignore Overlapping Window and it still performs in the same manner.  The error itself is an application error. 



The code around this looks as follows.  Basically application error appears when one button is clicked, it ignores the fact that the activity log is not the window present and moves on from there....



 w.btnOK.Click;



[[[[[ application error occurs and is subsequently closed ]]]]]



  w := p.WaitWindow('*', 'Activity Log', -1, 10000);

 

  IF w.Exists THEN BEGIN

   n := 0;  nmax:=40000;   

  while w.WndCaption = 'Activity Log' do

   begin

   if n>nmax then break;

    Delay(1000);        

   w  := GetActiveWindow();

    inc(n,1000);

    end;



-----------------------------------------------------------



So, why isn't it being recognized as an error and how can I correct this? 



Thanks,

Morgan
  • Morgan,


    TestComplete treats a window as unexpected if this window prevents the test engine from simulating user actions, and if this window didn't appear during the test creation.


    If your application's error window is not modal, then it does not block user input into other application windows and panels, so TestComplete does not consider this window as unexpected.


    Another possible cause is that your test does not contain operations that simulate user actions on the tested application after the error window appears (for instance, the code snippet you posted here does not include any test command that simulates user activity). Since there are no user actions, TestComplete cannot consider a window as unexpected.


    Also, please check whether your project has an OnUnexpectedWindow event handler. The handler's code can contain statements that prevent posting an error message to the log.