Forum Discussion

seanMRoss's avatar
seanMRoss
Contributor
12 years ago

Is it possible to log JavaScript errors during test runs?

Hello



Is there a way in which testcomplete can log JavaScript errors during a test run?



For example if I am running a test on a browser and the browser reports;



Unable to get value of the property 'JS Object': object is null or undefined 

page.js, line 187 character 3



Can testcomplete catch this and log it?



Thank you

3 Replies

  • aqAnt's avatar
    aqAnt
    SmartBear Alumni (Retired)

    Hello Sean,


    Unfortunately, TestComplete cannot catch the errors automatically. We have a corresponding suggestion in our DB, and your post has increased its rating.

  • Hi,

    Use exception handling.




    'Exception handling


      On Error Resume Next


      Err.Clear

    ' here you handle the exception


     ArraryVerify = Response.return.assetTrackVOs(0).assetId  ' write your hadle code


      if  Err.Number <> 0  then  


         ' An exception occurred


         log.Error  Err.Number 


         Log.Error  Err.Description 

    end if