Re: Remove test step from ALM using Java (240 Views)
Reply
Visitor
user_123456
Posts: 2
Registered: ‎04-30-2014
Message 1 of 3 (287 Views)
Accepted Solution

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

 

Honored Contributor
Trudy Claspill
Posts: 3,767
Registered: ‎09-09-2010
Message 2 of 3 (251 Views)

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
user_123456
Posts: 2
Registered: ‎04-30-2014
Message 3 of 3 (240 Views)

Re: Remove test step from ALM using Java

Thanks Trudy Claspill! you solved all my problems
The opinions expressed above are the personal opinions of the authors, not of HP. By using this site, you accept the Terms of Use and Rules of Participation.