TestLinkAPI missing custom fields

1 minute read

I have this sample program using the TestLinkAPI v1.9.2-2. I want to return the list of custom fields for a TestLink projects test cases.

<pre class="brush: java; ruler: true;">package testlink;

import br.eti.kinoshita.testlinkjavaapi.TestLinkAPI;
import br.eti.kinoshita.testlinkjavaapi.TestLinkAPIException;
import br.eti.kinoshita.testlinkjavaapi.model.TestCase;
import br.eti.kinoshita.testlinkjavaapi.model.TestSuite;
import br.eti.kinoshita.testlinkjavaapi.util.Util;

import java.net.MalformedURLException;
import java.net.URL;

/**
* Hello world!
* http://testlinkjavaapi.sourceforge.net/sample1.html
*/
public class App
{
public static void main( String[] args )
{
System.out.println( “Hello World!” );

String url = “http://xx/testlink/lib/api/xmlrpc.php”;
String devKey = “xx”;
TestLinkAPI api = null;

URL testlinkURL = null;

try
{
testlinkURL = new URL(url);
}
catch ( MalformedURLException mue )
{
mue.printStackTrace( System.err );
System.exit(-1);
}

try
{
api = new TestLinkAPI(testlinkURL, devKey);
}
catch( TestLinkAPIException te)
{
te.printStackTrace( System.err );
System.exit(-1);
}

System.out.println(api.sayHello());
System.out.println(api.getTestProjectByName(“xx”));
TestSuite suite = api.getFirstLevelTestSuitesForTestProject(new Integer(1))[0];
TestCase[] testcases = api.getTestCasesForTestSuite(suite.getId(), true, null);
for(int c = 0;c<testcases.length;c++) pre=”” system.out.println(testcase);=”” testcase=”” {=”” }<=”” }=””>
</pre>
The exported xml output from TestLink for the suite is

<pre class="brush: xml">




<summary></summary>


















<summary></summary>














</pre>But the program output is

<pre class="brush: bash">Hello!
TestProject [id=1, name=Touchpoint, prefix=TP, notes=, enableRequirements=true, enableTestPriority=true, enableAutomation=true, enableInventory=true, isActive=true, isPublic=true]
Install
TestCase [id=3, name=Import Indexes, testSuiteId=null, testProjectId=null, authorLogin=null, summary=null, steps=[], preconditions=null, testImportance=null, executionType=null, order=100, internalId=null, checkDuplicatedName=null, actionOnDuplicatedName=null, versionId=2, version=null, parentId=2, customFields=[], executionStatus=n]
n
[]
TestCase [id=5, name=Import Models, testSuiteId=null, testProjectId=null, authorLogin=null, summary=null, steps=[], preconditions=null, testImportance=null, executionType=null, order=101, internalId=null, checkDuplicatedName=null, actionOnDuplicatedName=null, versionId=2, version=null, parentId=2, customFields=[], executionStatus=n]
n
</pre>There are no Custom Fields listed. </testcases.length;c++)></pre>

Categories:

Updated:

Leave a Comment