This is the piece of code that throws the exception
[TestCleanup]
public void TestClean()
{
var status = TestContext.CurrentTestOutcome.ToString();
if (status == “Failed”)
{
Test.Log(LogStatus.Fail, “Test Fail”);
}
else
{
Test.Log(LogStatus.Pass, "Test Pass");
}
Extend.EndTest(Test);
}