How to remove a testCase of a testPlan ?

Discussion and information for XML-RPC interface.

Moderators: Amaradana, TurboPT, TL Developers

How to remove a testCase of a testPlan ?

Postby LauraG » Fri Jul 29, 2016 1:13 pm

Hi !

I am using the testlink java api to automate the creation of a whole project on testlink.
I managed to do it until now, when I have to deal with test case versions.

As a matter of fact, I have to create a testCase in a new version. I managed to do that but the problems comes after, when I try to add it to a test plan.

I just can't add the new version test case (it is giving me the error : Test Case version number 6 <> 10 (requested version) , is already linked to Test Plan ) but then the results are of course not put on the execution table...

Here is a sample of my java code :

Code: Select all
TestCase testCase=api.createTestCase(testCaseName, testSuiteId, projectId, authorLogin, testCaseDescription, steps,
                              preconditions, status, importance, ExecutionType.AUTOMATED,
                              testCaseOrder, testCaseId, true, ActionOnDuplicate.CREATE_NEW_VERSION);
api.addTestCaseToTestPlan(projectId, testPlanId, testCase.getId(), testCase.getVersion(), platformId, testCase.getExecutionOrder(), urgency_execution);




Did I do something wrong ?

Thank you !

EDIT
I tried to use the "overwrite" option you mentioned in a mantis ticket but I am still getting the same problem ... The test case which appears in the execution result view is always the first one and not the one which ahs just been executed.
LauraG
TestLink user
 
Posts: 14
Joined: Mon Jul 18, 2016 6:10 pm

Re: How to remove a testCase of a testPlan ?

Postby fman » Fri Jul 29, 2016 4:16 pm

1. TestLink version is always a MUST in any type of report you do.

2. Best thing is always check using our PHP clients, if result is KO => then report on MANTIS that is the place for Issues.

3. mantis is not site for issues regarding client api implementations (java,perl, etc), you need to report to author's site
fman
Member of TestLink Community
 
Posts: 3010
Joined: Tue Nov 15, 2005 7:19 am

Re: How to remove a testCase of a testPlan ?

Postby fman » Sun Jul 31, 2016 10:23 am

Just commited
https://github.com/TestLinkOpenSourceTR ... 0e456ed3a8

this is an effort to provide a complete example from scratch in PHP, that can be used to do tests than can be repeated by dev team and users, using same code.
I've tested an overwrite worked OK; replacing OLD LINKED TCVERSION to test plan, with VERSION provided in CALL.
Test done on test plan without PLATFORMS.

Anyway your post subject seems if not wrong at least misleading. You want to remove or you want to replace a test case version? these two things are different
fman
Member of TestLink Community
 
Posts: 3010
Joined: Tue Nov 15, 2005 7:19 am

Re: How to remove a testCase of a testPlan ?

Postby LauraG » Mon Aug 01, 2016 7:46 am

Thank you for the example you gave :)

May be I didn't explain my problem enough.

He is the XML file I am sending with an XLM-RPC request :

Code: Select all
<?xml version="1.0" encoding="UTF-8"?>
<methodCall><methodName>tl.addTestCaseToTestPlan</methodName><params><param><value> <struct>
<member><name>testprojectid</name><value><int>2753</int></value></member>
<member><name>testplanid</name><value><int>2754</int></value></member>
<member><name>testcaseexternalid</name><value><string>Chrono-5</string></value></member>
<member><name>version</name><value><int>9</int></value></member>
<member><name>overwrite</name><value><int>0</int></value></member>
</struct></value></param></params></methodCall>


I am sure of the values I am using in this file.
So I am sending this file and when I am looking on the execution view in TestLink, I can see that the test which has lastly been executed is the new version of the test case I am considering BUT at the bottom of the screen, this is still the VERSION 1 which is displaying. (I try to import an image file but couldn't do it because of the size of the file, sorry for that)

Did I make a mistake anywhere ?

Thank you !
LauraG
TestLink user
 
Posts: 14
Joined: Mon Jul 18, 2016 6:10 pm

Re: How to remove a testCase of a testPlan ?

Postby LauraG » Tue Aug 02, 2016 8:13 am

I finally managed to do what I wanted ! Stupid me, I didn't change the xmlrpc.class.php file and added the new version of the addTestCaseToTestPlan method including the overwrite parameter.

Now everything works OK !! Thank you for your precious help !

PS : I changed alors the overwrite value from 0 to 1 to make it works
LauraG
TestLink user
 
Posts: 14
Joined: Mon Jul 18, 2016 6:10 pm


Return to XML-RPC API



Who is online

Users browsing this forum: No registered users and 2 guests