How to update the details of a test suite ?

Discussion and information for XML-RPC interface.

Moderators: Amaradana, TurboPT, TL Developers

How to update the details of a test suite ?

Postby LauraG » Tue Aug 02, 2016 7:22 am

Hi ! I am using TestLink 1.9.14 and the java api (I also looked on the PHP api documentation) and I would like to know if it is possible to update the details of a given test suite in TestLink ?

Here is my code :
Code: Select all
TestSuite[] testSuitesInTestPlan = api.getTestSuitesForTestPlan(testPlanId);
      if(testSuitesInTestPlan.length!=0){
         for(int i=0;i<testSuitesInTestPlan.length;i++){
            if(testSuitesInTestPlan[i].getName().compareTo(testSuiteName)==0){ // here I look for a special test suite
               TestSuite testSuiteWithoutDetails = testSuitesInTestPlan[i];
               List<Integer> id = new LinkedList();
               id.add(testSuiteWithoutDetails.getId());
               TestSuite testSuite=api.getTestSuiteByID(id)[0];
               String old_description = testSuite.getDetails();
               testSuite.setDetails("hello"+old_description);
                               }
                         }
                }


The fact is that obviously the details of the test suite in TestLink are not updated, is there a method to do that ?

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

Re: How to update the details of a test suite ?

Postby fman » Tue Aug 02, 2016 2:50 pm

Have you read the code on testlink xmlrpc server to understand what are the available methods? this is firts thing you need to do (IMHO)
fman
Member of TestLink Community
 
Posts: 3010
Joined: Tue Nov 15, 2005 7:19 am

Re: How to update the details of a test suite ?

Postby LauraG » Tue Aug 02, 2016 3:06 pm

Yes I did and that's why I am asking in this forum this question. I want to make sure that there is no available method to update the details of a test suite using xmlrpc server.
If I am wrong, please let me know.
LauraG
TestLink user
 
Posts: 14
Joined: Mon Jul 18, 2016 6:10 pm

Re: How to update the details of a test suite ?

Postby fman » Wed Aug 03, 2016 5:21 pm

Is always important (IMHO) to provide evidence you have done some homework before asking.
Then saying:
I've already give a look to the code and was not able to find a method that allows me to do this or that

for me is very important.

Just add a FEATURE REQUEST on mantis and may be in the future method will be implemented, is the best way to go. (IMHO)
fman
Member of TestLink Community
 
Posts: 3010
Joined: Tue Nov 15, 2005 7:19 am

Re: How to update the details of a test suite ?

Postby LauraG » Mon Aug 08, 2016 2:15 pm

Thank you for your quick answer and implementation of the updateTestSuite method !!!

I have a new problem appearing now...

I am using Java code to create a XML file and then to send it with XML RPC call.
Here is the XML RPC file I am sending :
Code: Select all
<?xml version="1.0" encoding="UTF-8"?>
<methodCall>
  <methodName>tl.updateTestSuite</methodName>
  <params>
    <param>
      <value>
        <struct>
          <member>
            <name>devKey</name>
            <value>
              <string>[the value of my devkey]</string>
            </value>
          </member>
          <member>
            <name>testprojectid</name>
            <value>
              <int>895</int>
            </value>
          </member>
          <member>
            <name>details</name>
            <value>
              <string>hello new details</string>
            </value>
          </member>
        </struct>
      </value>
    </param>
  </params>
</methodCall>


But here is the response I am getting :
Code: Select all
<pre> ============================================================================== </pre><pre> DB Access Error - debug_print_backtrace() OUTPUT START </pre><pre> ATTENTION: Enabling more debug info will produce path disclosure weakness (CWE-200) </pre><pre>            Having this additional Information could be useful for reporting </pre><pre>            issue to development TEAM. </pre><pre> ============================================================================== </pre><pre> ============================================================================== </pre><?xml version="1.0"?>
<methodResponse>
  <params>
    <param>
      <value>
        <array><data>
  <value><struct>
  <member><name>status</name><value><boolean>1</boolean></value></member>
  <member><name>operation</name><value><string>updateTestSuite</string></value></member>
  <member><name>additionalInfo</name><value><string></string></value></member>
  <member><name>message</name><value><string></string></value></member>
</struct></value>
</data></array>
      </value>
    </param>
  </params>
</methodResponse>


What could be the problem ? (can't find any solution on the web for that)

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

Re: How to update the details of a test suite ?

Postby fman » Mon Aug 08, 2016 6:57 pm

IMHO you need to change your approach to forum usage and ticket reporting.
1. You have created this topic to understand if method exists, then when method has been created this topic/post has to be closed (thing I'm going to do locking it)

2. As said on several answers, I can check only tests done using PHP clients/examples (IMHO not to difficult to use no matter you know or not PHP, because only thing requested is to set a bunch of variables to do the call).

3. You need to open an ISSUE and forum.testlink.org is not place for issues (IMHO This has been clearly explained on README files provided with TestLink Distribution).

4. I've done my best for a quick implementation (that I've tested and seems to work), but I will not have time for this during next month, then you are going to wait.

LOCKING POST
fman
Member of TestLink Community
 
Posts: 3010
Joined: Tue Nov 15, 2005 7:19 am


Return to XML-RPC API



Who is online

Users browsing this forum: No registered users and 2 guests