Click here to Skip to main content
15,886,806 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
How do we create a shared step result programmatically in TFS 2012/MTM

There are no errors thrown but no updates on the result of the execution or run. I can successfully update a step that is not of the type shared.

Thanks in advance
Ravi S

So far i have:

C#
 foreach (ITestAction tstAction in tstCase.Actions)
            {
                tstSharedStep = null; //set shared step interface object to null
                tstSharedStepRef = tstAction as ISharedStepReference;
                    if (tstSharedStepRef != null)
                    {
                        tstSharedStep = tstSharedStepRef.FindSharedStep();
                        foreach (ITestAction tstSharedAction in tstSharedStep.Actions)
                        {
                            ITestStep tstSharedTestStep = tstSharedAction as ITestStep;
                            ..///DO some actions
                            ISharedStepResult tstSharedStepRslt = tstIterationRslt.CreateSharedStepResult(tstAction.Id, tstSharedTestStep.Id);
                            tstSharedStepRslt.Outcome =  PromptTextVerify ? TestOutcome.Passed : TestOutcome.Failed;
                            tstIterationRslt.Actions.Add(tstSharedStepRslt);
                        }
                    }
                    else
                    {
}
Posted

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900