Forum Discussion

srini_g_vasan's avatar
srini_g_vasan
Occasional Contributor
12 years ago
Solved

How can I propogate the error or exception

Team,



I did turn off stop on error setting ..



Now I m not sure how to handle exceptions or error by propogating the exception in method call stack. In java script looks like there is no way to throw exception from one method to another. all thrown exception needs to be handled in the same method



So how can i now report the calling method that something unexpected occured ?



Please advise.



Thanks.

Srini

6 Replies

  • srini_g_vasan's avatar
    srini_g_vasan
    Occasional Contributor
    If i have more hirearchy of method calls and if error occured at lower child in hirerachy tree then I should check for returned value in all levels and do action accordingly...



    Rather doing that is there any way to stop the execution and do appropriate action in handlers.



    Thanks



    Regards,

    Srini



  • srini_g_vasan's avatar
    srini_g_vasan
    Occasional Contributor
    Hello Gena,



    Thanks for your inputs.



    This is my scenario. I have group of test methods I will manually call and execute from a for loop in an custom execution engine.. When an exception or error occurs in one test case , I want my execution engine to run next test case.



    I see in Runner.Stop has parameter that stop only the current test. But that will help only when i select my test cases manually from test complete organize test and run it right?



    Is there any way i can do similiar function in my custom execution engine. Not sure whether i can write OnStopTest handler and call next test in queue,



    Pls advise



    Regards,

    Srini





     
  • karkadil's avatar
    karkadil
    Valued Contributor
    "But that will help only when i select my test cases manually from test complete organize test and run it right?"



    No, why? It doesn't matter how you run your tests (manually or scheduled), this method will always work. Just make sure you run tests using Test Items feature provided by TestComplete.