Forum Discussion

kingsmartbear's avatar
kingsmartbear
Contributor
14 years ago

I got "Script execution was interrupted" error even I did error handling.

Hi All:



   I'm using following subroutine to run some statement by using ExecuteGlobal statement.




Function GlobalExecute(Byref EvalString)

  Dim Result

  Result=False

  On Error Resume Next

  ExecuteGlobal EvalString

  If (Err.Number = 0) Then

    Result = True

  Else

    Log.Message ":-( Error happened."

    Err.Clear()

  End If

  GlobalExecute=Result

End Function




  I got "Script execution was interrupted" error message and script stopped at Bold line.



  How come On Error Resume Next statement can not handle what it should be?



  Any idea?



Thanks a lot,



Allan
  • tristaanogre's avatar
    tristaanogre
    Esteemed Contributor
    You've probably run across an error of not being able to execute something.  In this case, if I understand the syntax correctly, the problem is that EvalString is not in the globalname space it probably did not execute anything.
  • Hi Robert:



       Thanks for your reply.



      I did fully validation  with my scripts (actually it is a framework that I'm currently working on), each time I call this function I passed global variable to it.



      From what I understanding right now, I could path anything to it if I want regardless what I passed and TestComplete should not stop running my script because VBScript engine will return Err.Number and Err.Description to my script.



      I'm just wondering how TestComplete to handle the result that VBScript engine returned?



      Thanks again for your help,



    Allan
  • Hi,



    Exception handling works only for exceptions. If you get regular errors which make your test stop, it won't help. What is in 'EvalString'?