External ID - string or int?

LATEST Official version.
Questions and discussions - NO ISSUES
FOR ISSUES => http://mantis.testlink.org

Moderators: Amaradana, TurboPT, TL Developers

Post Reply
sybren
TestLink user
Posts: 3
Joined: Mon Sep 27, 2010 8:15 am

External ID - string or int?

Post by sybren »

Hey folks,

This is my first post to this forum. I've searched it for "external id", but didn't find anything related to what I want to ask.

In the XML examples in the 1.9-rc1 documentation (tl-file-formats.pdf) I see this XML snippet:

Code: Select all

<testcase external_id="POL-1" >
<result>f</result>
<notes>functionality works great KIMI</notes>
</testcase>
However, in the database table "tcversions" it seems that the external ID is an integer. I've tried importing a testcase with an ASCII external ID, and that worked without error message. However, when exporting to XML again the external ID has been set to "3" instead of the one I presented. It would seem that the documentation is wrong here, but I could be misinterpreting things.

Hopefully someone can shed some light on this.

Cheers,
Sybren


PS: This is the XML I used to create the test suite & case:

Code: Select all

<?xml version="1.0" encoding="UTF-8"?>
<testsuite name="">
  <node_order></node_order>
  <details></details>
  <testsuite name="External ID test">
    <node_order>1</node_order>
    <details>Testing external ID</details>
    <testcase name="EXID">
      <node_order>100</node_order>
      <externalid>EXID-1</externalid>
      <summary>Test the external ID</summary>
      <preconditions></preconditions>
      <execution_type>2</execution_type>
      <importance>2</importance>
      <steps>
        <step>
          <step_number><![CDATA[1]]></step_number>
          <actions><![CDATA[<p>Import the XML</p>]]></actions>
          <expectedresults><![CDATA[<p>Suites and cases are created.</p>]]></expectedresults>
          <execution_type><![CDATA[2]]></execution_type>
        </step>
        <step>
          <step_number><![CDATA[2]]></step_number>
          <actions><![CDATA[<p>Export the XML again</p>]]></actions>
          <expectedresults><![CDATA[<p>The external ID "EXID-1" can be seen on this test case.</p>]]></expectedresults>
          <execution_type><![CDATA[2]]></execution_type>
        </step>
      </steps>
    </testcase>
  </testsuite>
</testsuite>
fman
Member of TestLink Community
Posts: 3123
Joined: Tue Nov 15, 2005 7:19 am

Re: External ID - string or int?

Post by fman »

Important thing to understand:
WHEN IMPORTING Test Case Spec: EXTERNAL ID is used (if used) ONLY TO UNDERSTAND if test case already exists on system, but is value for NON EXISTENT test cases (new test cases) will be ALWAYS assigned by Test Link, i.e. user CAN NOT FORCE an ID for a test case.
Is right to provide this value WHEN EXPORTING because is a better reference than the internal ID (autoincrement field), because on UI internal ID is never displayed.

Surelly an homogeneous format on all type of XML files will be better, we will try to think about this kind of change in future.
Having prefix on EXTERNAL ID on results.xml is a way to understand the Test Project to which Test Case belongs.
sybren
TestLink user
Posts: 3
Joined: Mon Sep 27, 2010 8:15 am

Re: External ID - string or int?

Post by sybren »

Ok. It's nice that it works in a reliable, well-defined way.

When importing my XML was accepted without any warning. I'd rather see a message stating "you provided an external ID ABC-DEF but that isn't going to be used." - that would make things a whole lot clearer. Accepting data and then ignoring it silently isn't all that user-friendly IMO.
sybren
TestLink user
Posts: 3
Joined: Mon Sep 27, 2010 8:15 am

Re: External ID - string or int?

Post by sybren »

PS: Often an "external ID" is used to denote an identifier from an external system, which is thus defined by that external system. With TestLink it is used in a different way, which I found confusing.
Post Reply