XML import format

Alan Bowman, geändert vor 10 Jahren.

XML import format

Youngling Beiträge: 3 Beitrittsdatum: 03.02.14 Neueste Beiträge
I am trying to import test cases using the XML format, as specified in the manual. However, I keep getting an error "Unable to upload the file, due to validation error: Invalid Format", which doesn't provide a lot of clues as to where I am going wrong. I am a bit of a beginner with XML, but this seems to be the best way to import our existing tests. Is there a sample XML (or XSD) file that I could use as a starting point for the import file creation?

Thanks

Alan
thumbnail
Patrick Reilly, geändert vor 10 Jahren.

RE: XML import format

Padawan Beiträge: 71 Beitrittsdatum: 23.02.11 Neueste Beiträge
Hi Alan,

Welcome to the community.

It seems that this is missing from our documentation!

The XSD file may be found at http://www.klaros-testmanagement.com/files/klaros-testcases.xsd . I have added this to the documentation for the version 4.1.2.

Thanks for your interest in Klaros-Testmanagement. We're here to answer any further questions you might have.

Regards,
Patrick
Alan Bowman, geändert vor 10 Jahren.

RE: XML import format

Youngling Beiträge: 3 Beitrittsdatum: 03.02.14 Neueste Beiträge
Thank you for the schema file. However, it doesn't seem to have helped...

I have used the schema to auto-generate some valid XML. When I try to upload this I still get an "invalid format" error.

I have also tried exporting data from my test installation, stripping out all but the test cases. This fails validation against the schema, but successfully uploads. It doesn't create the tests I expect, but it's a useful datapoint.

I sort of expect that I can create an XML file which will import a series of testcases into the currently selected project. Have I understood correctly, or do I also need to define which project the cases will be added to?

Alan
thumbnail
Patrick Reilly, geändert vor 10 Jahren.

RE: XML import format (Antwort)

Padawan Beiträge: 71 Beitrittsdatum: 23.02.11 Neueste Beiträge
Hi Alan,

The following (very) simple file will import a single test case consisting only of a name (also attached to this post):

<klaros:container xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
            xsi:schemaLocation="http://klaros-testmanagement.com/export-testcases-1.0"
            xmlns:klaros="http://klaros-testmanagement.com/export-testcases-1.0">
  <klaros:testcases>
    <klaros:testcase>
      <klaros:shortname>Test Case Name</klaros:shortname>
    </klaros:testcase>
  </klaros:testcases>
</klaros:container>


Hopefully this will help you.

In order to import it into the project with the ID P1 in Klaros-Testmanagement the following curl command may be used:

curl -v -T test-case-import.xml "http://localhost:18080/klaros-web/seam/resource/rest/import/testcase/xml?config=P00001"


of course replacing localhost with the hostname if not run on the computer running Klaros-Testmanagement.

I hope this helps.

Regards,
Patrick
Alan Bowman, geändert vor 10 Jahren.

RE: XML import format

Youngling Beiträge: 3 Beitrittsdatum: 03.02.14 Neueste Beiträge
Excellent - that appears to have done the job. Thanks!