I have one test method in which i have called one function and in that function it further calls the evaluate function as which is mentioned below.
protected bool Evaluate(bool condition, string message)
{
if (!condition)
{
Driver.Browser.GetScreenShot(@SKPConfigSettings.Logging.ScreenShotPath, TestContext.TestName, Core.Drivers.Enums.ScreenshotFormat.Png, true);
Logger.LogError(message);
Logger.LogError(Constants.Messages.TCFail);
return false;
}
else
return true;
}
Problem is TestContext.TestName
is always null
, it does not gets the method name. It gets the method name in the test method but not in this way. Can anyone provide the solution?