Getting Null value in PropertyInfo How to fix it?

Trying to create Extent Report using specflow

var stepType = ScenarioStepContext.Current.StepInfo.StepDefinitionType.ToString();

PropertyInfo pInfo = typeof(ScenarioContext).GetProperty(“TestStatus”, BindingFlags.Instance | BindingFlags.NonPublic);

MethodInfo getter = pInfo.GetGetMethod(nonPublic: true);
object TestResult = getter.Invoke(ScenarioContext.Current, null);

Add Comment
  • 0 Answer(s)
  • Your Answer

    By posting your answer, you agree to the privacy policy and terms of service.