18 January 2026:


This forum is now archived and is in read-only mode. Please continue discussions on our improved new Sahi Pro Community forum.



Sahi Pro is an enterprise grade test automation platform which can automate web, mobile, API, windows and java based applications and SAP.

Get caller function name

felixfelix Members
edited November -1 in Sahi - Open Source
I looked at the post "I need help with Sahi syntax to obtain function name", and used that code to get a function's callee's name.

I also want to get a function's caller's name. Here's my attempt:

function CallMe() {
logFunctionName (arguments.callee.name);
logFunctionName(arguments.callee.caller.name); // TypeError: Cannot read property "name" from undefined
}

function foo() {
CallMe();
}

foo();

/* --- Placed in Common Sah --- */
function logFunctionName ($funcName) {
_log("*********** " +$funcName + " ************");
}

"arguments.callee.caller.name" gets me the error "TypeError: Cannot read property "name" from undefined". Any ideas?

Cheers,

Felix

Comments

  • narayannarayan Administrators
    Hi Felix,
    In the coming Pro version, the functions will automatically be clubbed together in the logs, so that you can easily see which function was called and what the parameter values were.
    If you wish, you can drop an email to support@sahi.co.in and we will set up a demo for you.
    Regards,
    Narayan
  • Hello Narayan,

    Thanks for the quick response!

    That sounds interesting! Currently I am using _stackTrace() to get the function names.

    Can you tell me when the release date for the Pro version is? And the date for the next free version? I checked out "Sahi Free Edition Next Release Date", but there is still no response.

    Cheers,

    Felix
Sign In or Register to comment.