Forum Discussion

Jagruuti's avatar
4 years ago

Is it possible to debug the event handler code?

I'm trying to execute the complete test case. My test case gets failed at the last step where I have used the event handler code to check if my authorization token has got expired or not. If it is expired, it creates a new one. If it is not- it continues with that old token. My test case gets hanged at the last step.

I think that it might be because of the use of while loop in the event handler code.  But the execution shows it is getting hanged at the Transfer step.


but when I verify that in the individual step, I find that the value has already got transferred in the last step. So I think it might be the issue with the last step.


I tried debugging using the Step-by-Step Run feature but there also it gets hanged and I cannot take much inference from there as shown below




3 Replies

  • richie's avatar
    Community Hero
    Hey Jagruuti,

    Have you reviewed the logging when you execute the test case (NOT one step at a time)?

    In regards to debugging the event handler script, unless the other forum lads/ladies have a better idea i think you have 2 choices.

    Add in logging into your script and monitor the script.log when you execute the test case (not sure if the event handler script would execute if you run the test case steps one by one)
    OR copy the event handler script into a groovy step (making appropriate changes to get it to run in an individual test step) and you can use the debug functionality (as long as your java (if its oracle java) is a jdk rather than jre as the debug functionality uses 2 libraries that dont exist in the jre...theyre only found in the jdk).

    Thats all i i say above perhaps the other forum members might havr a better idea!


    • sonya_m's avatar
      SmartBear Alumni (Retired)

      Thanks Richie!


      Jagruuti have you tried the mentioned approaches?

      • Jagruuti's avatar

        Hi richie ,


        1) Nothing comes under the script log as shown in the first screenshot.

        2) I have the jre folder though I'm able to debug it (Was this the same thing you were mentioning about?). I need to make the appropriate changes in the Groovy script to suit the test steps. Will update once I'm done.


        Note: I cannot perform the second step as the request has suddenly stopped producing access tokens. Has raised a support ticket for the same. Will update once it is solved and I can try out your second solution.


        Thanks for your help!