¿Restaurar el orden de TestSuites a partir de una respuesta Testlink XML-RPC?

Me gustaría usar el Testlink API para recuperar TestCases/TestSuites and display them in a report. They should be sorted in the same order as they appear in the Testlink 'Test Specification' (a folder-like structure that can be reordered by mouse drag-and-drop).

Cada TestCase returned by the RPC-XML API consists of a parameter z that describes its position within a TestSuite. Reconstructing the order of TestCases is therefore possible. However, there is no analogous parameter for ordering TestSuites within a project. For example, the following two lines can be used to obtain the TestSuites from Testlink...

conn = new TestLinkAPIClient(testlinkKey, testlinkURL);
TestLinkAPIResults suites = conn.getTestSuitesForTestPlan(testplanID);

... but the result only contains information about their hierarchy (parent_id), no information about their order is available.

Result[0] = {id=6754, name=TestThree, parent_id=6752}
...
Result[8] = {id=22818, name=TestOne, parent_id=6754}
Result[9] = {id=22819, name=TestTwo, parent_id=6754}

Is is possible to somehow reconstruct the order from the XML-RPC response so that I can list the Testcases exactly as they appear in the 'Test Specification'?

preguntado el 31 de julio de 12 a las 13:07

Maybe you could post a screenshot of the GUI and the contents of the XML-RPC response? -

1 Respuestas

You can use a kind of "cheating way" to get the order :

conn = new TestLinkAPIClient(testlinkKey, testlinkURL);
TestLinkAPIResults suites = conn.getTestSuitesForTestPlan(testplanID);
for(int i=0; i<suites.length;i++){
   List<Integer> id = new LinkedList();
   id.add(suites[i].getId());
   System.out.println("order for "+suites[i].getName()+" = "+conn.getTestSuitesById(id)[0].getOrder());
}

I personnally used the testlink java api https://jar-download.com/java-documentation-javadoc.php?a=testlink-java-api&g=br.eti.kinoshita&v=1.9.2-1 but I think yours is quite the same.

Espero que te ayude

Respondido 02 ago 16, 14:08

No es la respuesta que estás buscando? Examinar otras preguntas etiquetadas or haz tu propia pregunta.