I want to know if there is a way to run a recording in the teardown of a testcase, only if the testcase execution failed?
Running a user code in the teardown on fail is easy:
Code: Select all
public static void MyUserCodeMethod()
{
if (TestSuite.CurrentTestContainer.Status == Ranorex.Core.Reporting.ActivityStatus.Failed)
{
... my code ...
}
}
But, as there are no smart folders for conditions or other structural containers available in the teardown, the only solution I can think of is running the recording from a user code (which I don't really like):
Code: Select all
public static void MyUserCodeMethod()
{
if (TestSuite.CurrentTestContainer.Status == Ranorex.Core.Reporting.ActivityStatus.Failed)
{
myRecording.Start();
}
}
thanks!