Quality Center / ALM Practitioners Forum
Showing results for 
Search instead for 
Do you mean 

Remove test step from ALM using Java

SOLVED
Go to Solution
Highlighted
Visitor

Remove test step from ALM using Java

Hi, I am trying to remove all test steps for a specific Test Case in alm.

I am using com4j bridge and alm 11.

 

so far I managed to add number of steps to a test case but I can not detem them.

 

my code to add steps:

 

IBaseFactory iFactory = iTest.designStepFactory().queryInterface(IBaseFactory.class);

IDesignStep iStep = iFactory.addItem("Step name ").queryInterface(IDesignStep.class);

 

I tryied:

 

IBaseFactory iFac = iTest.designStepFactory().queryInterface(IBaseFactory.class);
IList steps = iFac.newList("");

for (int i = 1; i <= steps.count(); i++) {

iFac.removeItem(i);

}

 

it compiles and runs however steps are not deleted from ALM

Please help

 

2 REPLIES
Honored Contributor

Re: Remove test step from ALM using Java

This line is wrong

 

iFac.removeItem(i);

 Where you are using "i" you need to be using the DesignStep ID value. "i" is just the index of the steps in the list you retrieved. Instead you need to use

 

iFac.removeItem(IList.item(i).ID);

 

[If this post solves or helps solve your issue, mark the thread as solved and give KUDOS to the author for their assistance.]

(Opinions expressed in my postings are mine alone, and do not reflect the opinions of my employer.No warranties express or implied for any solution/suggestion posted.)
Visitor

Re: Remove test step from ALM using Java

Thanks Trudy Claspill! you solved all my problems