TestProject Forum

How to get StackTrace in case of failures : OpenSDK(JavaScript)

Hi Team,

Hope you guys are doing well.

I am using OpenSDK with JavaScript/TypeScript. In case of failures, I want to get complete stacktrace printed in my report. Is there any features available ?

Regards,
Gorav:)

Hi @GoravGupta , how do you run the test file in your project? Are you using any test framework like Jest?

Hi @yunpeng.xu ,

I am using Chai framework.

Hi @GoravGupta.
I’m assuming you are referring to the automatic reporting feature. That feature only reports the driver commands and its message/parameters, not your code’s stack trace. If you want to add specific information you can do so using the manual reporting feature as demonstrated here.

Hi @shai.glatshtein_prd

My question is more on code stack trace(As we see in any IDE) so that we can debug the code in case of failures(At what line, what is exception thrown etc.)

If you would like to check the stack trace when an error is thrown, you can use the traceback module to get the stack trace.

Thanks @shai.glatshtein_prd
Can you please share some documents/reference which I can follow?