Page 1 of 1

External ID - string or int?

Posted: Mon Sep 27, 2010 8:27 am
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>

Re: External ID - string or int?

Posted: Mon Sep 27, 2010 9:41 am
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.

Re: External ID - string or int?

Posted: Tue Sep 28, 2010 5:59 am
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.

Re: External ID - string or int?

Posted: Tue Sep 28, 2010 6:12 am
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.