Product Screenshots

Support Forum

Discussions and announcements.

You are not logged in. Please login or register.


Post new reply

Post new reply

Compose and post your new reply

You may use: BBCode Images Smilies

All fields labelled (Required) must be completed before the form is submitted.

Required information for guests



   
Required information
[b][i][u][url][email][img][list][*][quote][code][color=]
:) :| :( :D :o ;) :/ :P :lol: :mad: :rolleyes: :cool:
Optional post settings

Topic review (newest first)

4

Hi asm,

Thanks a lot for sharing your scripts, we really appreciate it. I will make sure to try your scripts today (and recommend them to other customers who want to migrate from TestLink). Thanks again!

Regards,
Tobias

3

I created an XSLT Transform and a quick perl script that works fairly well. You can run them from bash as follows:

    xsltproc tl2tr.xslt all_testsuites.xml  | tr "\n" " " | ./transform.pl| xmllint --format - > import.xml

tl2tr.xslt

<?xml version="1.0"?>
<xsl:stylesheet version="1.0"
                xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:template match="/">
  <xsl:for-each select="testsuite">
    <xsl:call-template name="sections" />
  </xsl:for-each>
</xsl:template>
<xsl:template name="sections">
  <xsl:if test="count(testsuite) &gt; 0">
  <sections>
    <xsl:for-each select="testsuite">
      <section>
        <name><xsl:value-of select="@name" /></name>
        <xsl:if test="count(testcase) &gt; 0">
        <cases>
          <xsl:for-each select="testcase">
            <xsl:call-template name="testcase" />
          </xsl:for-each>
        </cases>
        </xsl:if>
        <xsl:call-template name="sections" />
      </section>
    </xsl:for-each>
  </sections>
  </xsl:if>
</xsl:template>
<xsl:template name="testcase">
  <case>
    <title><xsl:value-of select="@name" /></title>
    <type></type>
    <priority></priority>
    <estimate></estimate>
    <milestone></milestone>
    <preconds><xsl:value-of select="summary" /></preconds>
    <steps><xsl:value-of select="steps" /></steps>
    <expected><xsl:value-of select="expectedresults" /></expected>
  </case>
</xsl:template>
</xsl:stylesheet>

transform.pl
while(<>)
{
    # bulleted lists
    s/&lt;li&gt;/\n-/g;
    s/&lt;\/li&gt;//g;

    # kill all html
    s/&lt;\/?[a-z]+( .*?)?&gt;//g;
    print;
}

2

Already answered this via email, but to let other readers know as well:

We currently do not have a conversion script available but are looking into providing tools to convert and import other formats directly into TestRail.

Regards,
Tobias

1

Has anyone converted test cases from TestLink XML to the TestRail format?