public static string GetPageObjectFunctionName()
{
string functionName = "";
System.Diagnostics.StackTrace callStack = new System.Diagnostics.StackTrace();
System.Diagnostics.StackFrame[] frames = callStack.GetFrames();
foreach (System.Diagnostics.StackFrame frame in frames)
{
if (frame.GetMethod().ToString().Contains("PageObject"))
{
functionName = frame.GetMethod().ReflectedType.Name + "." + frame.GetMethod().Name.ToString();
}
}
return functionName;
}