cancel
Showing results for 
Search instead for 
Did you mean: 

Is it possible to debug the event handler code?

Highlighted
Contributor

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.

Jagruuti_1-1598701089048.png

 

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

Jagruuti_3-1598703138272.png

 

 

 

3 REPLIES 3
Highlighted
Community Hero

Re: Is it possible to debug the event handler code?

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 got....as i say above perhaps the other forum members might havr a better idea!

Ta

Rich
if this helped answer the post, could you please mark it as 'solved'? Also if you consider whether the title of your post is relevant? Perhaps if the post is solved, it might make sense to update the Subject header field of the post to something more descriptive? This will help people when searching for problems. Ta
Highlighted
Community Manager

Re: Is it possible to debug the event handler code?

Thanks Richie!

 

@Jagruuti have you tried the mentioned approaches?


Sonya Mihaljova
Community and Education Specialist

Did my reply answer your question? Give Kudos or Accept it as a Solution to help others. ⬇️⬇️⬇️
Highlighted
Contributor

Re: Is it possible to debug the event handler code?

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! 

Regards,

Jagruuti

 

New Here?
Join us and watch the welcome video:
Announcements
Top Kudoed Authors