Page 1 of 1

How to remove a testCase of a testPlan ?

PostPosted: Fri Jul 29, 2016 1:13 pm
by LauraG
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.

Re: How to remove a testCase of a testPlan ?

PostPosted: Fri Jul 29, 2016 4:16 pm
by fman
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

Re: How to remove a testCase of a testPlan ?

PostPosted: Sun Jul 31, 2016 10:23 am
by fman
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

Re: How to remove a testCase of a testPlan ?

PostPosted: Mon Aug 01, 2016 7:46 am
by LauraG
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 !

Re: How to remove a testCase of a testPlan ?

PostPosted: Tue Aug 02, 2016 8:13 am
by LauraG
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