Join 34,000+ subscribers and receive articles from our blog about software quality, testing, QA and security.
 

Exporting test scripts to excel - all test steps are in one cell

This has been raised before - back in oct 17 with a comment " coming in a future release". So when are we getting this functionality?.

We constantly push to keep scripting in TestRail but when we have to share test scripts with other areas of the business but exporting into excel in order to upload to google sheets this becomes very messy.

cheers
Jackie

1 Like

Jackie, here are two workarounds that get you close(er) until Gurock gets around to this request.

Option 1: Import XML into Excel

  1. Export as XML
  2. Use Developer tools to import XML

This will get the steps on their own line although it’s still busy since it repeats all the other cell data for each test step.

If it were me, I’d write a quick tool to process the exported XML into a format/viewer that works for my users. Another option is to just hand over the XML. They can open the XML in any browser to get a structured and collapsible view. Might be too busy for some users though.

More on XML->EXCEL approach here:
https://binged.it/2J5mOfR

Option 2: Provide xslt (stylesheet) to format the xml into a styled web document. This is the recommended approach.

Save the following xslt code to a file named MyTestStyle.xslt to your preferred document folder. Export your testsuite as XML and place in the same folder. Edit the xml and place this line at top, save and close.
<?xml-stylesheet type='text/xsl' href='MyTestStyle.xslt'?>

Now, open the xml file in a browser and it should display as a web page. From here you have some options.

  1. Provide both these files to your users and instruct them to open the xml as you did.
  2. Save the web page as a single .htm file and post/send your users just htm file.
  3. The Edge browser (IE), has an option to import the .htm into Excel (assuming you have it) which would get you back into Excel with each step on it’s own line but the result is similar to the 1st option.

Lastly, I only provided enough style to get the example done. This stylesheet can be enhanced with nicer formatting and more data. Up to you.

[XSLT FILE - COPY EVERYTHING BELOW HERE INTO THE .xslt file]
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version=“1.0”
xmlns:xsl=“http://www.w3.org/1999/XSL/Transform”>

  <xsl:template match="/">
    <html>
      <body>
        <h2>My Tests</h2>
        <table border="1">
          <tr bgcolor="white">
            <th>Case Title</th>
            <th>Case Steps</th>
            <th>Expected</th>
          </tr>
          <xsl:for-each select="suite/sections/section/cases/case">
            <tr>
              <td>
                <xsl:value-of select="title"/>
              </td>
              <td></td>
              <td></td>
            </tr>
            <xsl:for-each select="custom/steps_separated/step">
              <tr>
                <td></td>
                <td><xsl:value-of select="index"/>. <xsl:value-of select="content"/></td>
                <td>
                  <xsl:value-of select="expected"/>
                </td>
              </tr>
            </xsl:for-each>
          </xsl:for-each>
        </table>
      </body>
    </html>
  </xsl:template>

</xsl:stylesheet>

Thanks Alex the first option seems pretty straightforward so will go with that for now.

cheers

Jackie