Forum Discussion

neha_sharma's avatar
neha_sharma
Contributor
10 years ago
Solved

Unexpected window handling

Hi,



I am trying to handle unexpectwed windows in my application.



I am getting an error "ADODB.Connection Provider not found".

So i am looking for TestComplete to close this window and procceed with the execution of next ProjectTestItem.



Here are the steps i have tried:

1.Added event onUnexpectedWindow and the code is:




Sub GeneralEvents_OnUnexpectedWindow(Sender, Window, LogParams)


  '@@ Close the unexpected window


  Call Window.Close


End Sub



2.Stop on error is unchecked in Default project properties.



3.I have added Stop on error and Stop on Exception ,set them as None in ProjectTest items.



4. The autowait timeout is 50ms in Default project Properties --> Playback.



Then also i am not able to close the Error window in automation and proceed to run next Test item.I have to do it manually.I have attached a screenshot of the window i want to close.

After this window i need to handle the window that ask to continue with next Project test item or stop execution.



Thanks,

Neha

 

6 Replies

  • Hi,



    Does anyone has any idea about this. I have followed all steps mentioned in Help.

    Still not able to close window.



    -Neha
  • Hi,



     Replying my own question,the window i was looking to click was a vbscript runtime error.I am able to bypass it by disabling error dialgoue and implementing on error resume next in my code.

    I am also able to click on Unexpected window which is displayed for automatic crash recovery in IE.



     Thanks,

    Neha
  • Ravik's avatar
    Ravik
    Super Contributor


    Hi Neha,



    Try On Error Resume Next statement in your code, this may help you.



    It will be ignore any unexpected window and moving for the next step.



    Sample -



    On Error Resume Next



    ' Your code goes here



    If Err.Number <> 0 Then   (option)

       

      'error handling:

        log.message  &  Err.Description

        Err.Clear



    End If

  • Ravik's avatar
    Ravik
    Super Contributor


    Hi Neha,



    Try On Error Resume Next statement in your code, this may help you.



    It will be ignore any unexpected window and moving for the next step.



    Sample -



    On Error Resume Next



    ' Your code goes here



    If Err.Number <> 0 Then   (option)

       

      'error handling:

        log.message  &  Err.Description

        Err.Clear



    End If


  • Hi Ravi,


     


    I have already implemented on error resume next and onUnexpectedWindow handler to handle unexpected windows and runtime exceptions in my code.

    Thanks for the reply.


     


     Thanks,


    Neha