C#
An object-oriented and type-safe programming language that has its roots in the C family of languages and includes support for component-oriented programming.
11,100 questions
This browser is no longer supported.
Upgrade to Microsoft Edge to take advantage of the latest features, security updates, and technical support.
I want to update shared steps in my testcase using C# program,
I was able to get the shared steps reference with below code, but found that it is not updating the shared steps in tfs.. giving error "The ids and revisions collections must have the same length."
ITestIterationResult iterationResult = GetIterationResult(mCurrentTestCaseID, result);
ITestCase testCase = result.GetTestCase();
if (testCase.Actions[mCurrentSharedStep] is ISharedStepReference sharedStepReference)
{
ISharedStep sharedStep = sharedStepReference.FindSharedStep();
TFSPluginLog.Write(LogType.Info, "UpdateSharedStepResult: " + sharedStep);
foreach (ITestAction action in sharedStep.Actions)
{
if (action is ITestStep subTestStep)
{
//ISharedStepResult sharedStepResult = iterationResult.CreateSharedStepResult(action.Id, subTestStep.Id);
ISharedStepResult sharedStepResult = iterationResult.CreateSharedStepResult(testCase.Actions[mCurrentSharedStep].Id, subTestStep.Id);
sharedStepResult.Comment = comments[index];