Creating a report to display test cases with execution counts

Wednesday, March 27, 2019
Avatar

Dear all

Please help me.

i am executing below  query for custom report.  shows only shows headers.

<?xml version="1.0" encoding="utf-8"?><xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:msxsl="urn:schemas-microsoft-com:xslt" exclude-result-prefixes="msxsl">  <xsl:template match="/TestCaseData">    <table class="DataGrid" style="width:100%">      <tr>        <th>Test #</th>        <th>Name</th>        <th>Status</th>        <th>Last Executed</th>       <th>Execution Count</th>      </tr>      <xsl:for-each select="TestCase">        <tr>          <td>            <xsl:value-of select="TestCaseId"/>          </td>          <td>            <xsl:attribute name="style">              padding-left: <xsl:value-of select="string-length(IndentLevel)*2"/>px;            </xsl:attribute>            <xsl:if test="FolderYn='Y'">              <b>                <xsl:value-of select="Name"/>              </b>            </xsl:if>            <xsl:if test="FolderYn='N'">              <xsl:value-of select="Name"/>            </xsl:if>          </td>          <td>            <xsl:value-of select="ExecutionStatusName"/>          </td>          <td class="Date">            <xsl:call-template name="format-date">              <xsl:with-param name="datetime" select="ExecutionDate" />            </xsl:call-template>          </td>          <td>            <xsl:value-of select="count(TestRuns/TestRun)"/>          </td>        </tr>      </xsl:for-each>    </table>  </xsl:template>  <xsl:template name="format-date">    <xsl:param name="datetime"/>    <xsl:variable name="date" select="substring-before($datetime, 'T')" />    <xsl:variable name="year" select="substring-before($date, '-')" />    <xsl:variable name="month" select="substring-before(substring-after($date, '-'), '-')" />    <xsl:variable name="day" select="substring-after(substring-after($date, '-'), '-')" />    <xsl:variable name="time" select="substring-before(substring-after($datetime, 'T'), '.')" />    <xsl:variable name="monthname">      <xsl:choose>        <xsl:when test="$month='01'">          <xsl:value-of select="'Jan'"/>        </xsl:when>        <xsl:when test="$month='02'">          <xsl:value-of select="'Feb'"/>        </xsl:when>        <xsl:when test="$month='03'">          <xsl:value-of select="'Mar'"/>        </xsl:when>        <xsl:when test="$month='04'">          <xsl:value-of select="'Apr'"/>        </xsl:when>        <xsl:when test="$month='05'">          <xsl:value-of select="'May'"/>        </xsl:when>        <xsl:when test="$month='06'">          <xsl:value-of select="'Jun'"/>        </xsl:when>        <xsl:when test="$month='07'">          <xsl:value-of select="'Jul'"/>        </xsl:when>        <xsl:when test="$month='08'">          <xsl:value-of select="'Aug'"/>        </xsl:when>        <xsl:when test="$month='09'">          <xsl:value-of select="'Sep'"/>        </xsl:when>        <xsl:when test="$month='10'">          <xsl:value-of select="'Oct'"/>        </xsl:when>        <xsl:when test="$month='11'">          <xsl:value-of select="'Nov'"/>        </xsl:when>        <xsl:when test="$month='12'">          <xsl:value-of select="'Dec'"/>        </xsl:when>        <xsl:otherwise>          <xsl:value-of select="''" />        </xsl:otherwise>      </xsl:choose>    </xsl:variable>    <xsl:value-of select="concat($day, '-' ,$monthname, '-', $year , ' ', $time)" />  </xsl:template></xsl:stylesheet>

 

2 Replies
Monday, April 1, 2019
Avatar
inflectra.jimx
re: rammurti Wednesday, March 27, 2019

I would run the same report in 'Raw XML' mode and see what data is returned.

Then see if your XSLT query pulls back the data.

Regards

Jim

Tuesday, April 9, 2019
Avatar
re: inflectra.jimx Monday, April 1, 2019

Using above query I can view data only in xml format.but  when i try to view report in other formats(pdf, word or excel) only report header is displayed.

Please help.

Spira Helps You Deliver Quality Software, Faster and With Lower Risk

And if you have any questions, please email or call us at +1 (202) 558-6885

 

Statistics
  • Started: Wednesday, March 27, 2019
  • Last Reply: Tuesday, April 9, 2019
  • Replies: 2
  • Views: 1354