In the Quality Center OTA API how can you delete steps from a test. When I delete steps using the RemoveItem method of the DesignStepFactory, they still remain - I've tried deleting by both ID and step reference:
Test test = _qcAccess.AddTest(folderId);
test.Name = "Test 1";
test.Post();
DesignStepFactory factory = (DesignStepFactory) test.DesignStepFactory;
DesignStep step = (DesignStep)factory.AddItem(1);
step.StepName = "Step1";
step.Post();
Test test2 = _qcAccess.FindExistingTest((int)test.ID);
DesignStepFactory factory2 = (DesignStepFactory) test2.DesignStepFactory;
Assert.Equal(1, test2.DesStepsNum);
factory2.RemoveItem(factory2[0]);
test2.Post();
Test test3= _qcAccess.FindExistingTest((int)test.ID);
Assert.Equal(0, test3.DesStepsNum); // test fails here, DesStepsNumb is still 1
According to the OTA API documentation
RemoveItem Method
Description: Removes item from the database. Removal takes place immediately, without a Post.
Syntax:
Public Sub RemoveItem(ByVal ItemKey As Variant)
ItemKey:
The Step.ID (long), a reference to the Step Object or a Variant array of Step.IDs.Step.IDs.
So it looks like it should work. FYI this is for QC10.
Any thoughts?