Custom Report Examples

Ask general questions here.
armstronghm24
Posts: 38
Joined: Tue Dec 20, 2016 10:16 pm

Custom Report Examples

Post by armstronghm24 » Fri Jan 26, 2018 4:39 pm

I want to get ideas for customizing my Ranorex report. Can anyone share some examples of ways you have customized your report to provide more value or organized the information better?

One thing I might like to do is expand the test data portion of my cases automatically while leaving the other sections collapsed.

User avatar
odklizec
Ranorex Guru
Ranorex Guru
Posts: 3922
Joined: Mon Aug 13, 2012 9:54 am
Location: Zilina, Slovakia

Re: Custom Report Examples

Post by odklizec » Mon Jan 29, 2018 9:39 am

Hi,

The only customization I'm doing in my reports is adding data connector rows in the header of each iteration. So then I can easily identify individual iterations, without the need to expand each iteration.
CustomReport.png
CustomReport.png (9.18 KiB) Viewed 403 times
I'm adding this code to RanorexReport.xsl (right after "<!--PARAMETER OR DATA COLUMN 'NAME - VALUE' TEMPLATE-->" section):

Code: Select all

    <xsl:template match="activity[(@type='test-case' or @type='smart-folder') and @type!='iteration-container' and @activity-exectype='dataiteration']">
        <xsl:param name="itemCount" />


        <li class="{@result} iteration" id="iteration{@rid}">
            <h2 class="{@result}" onclick="OnLoadContentDynamic('{@rid}','iteration',this);">
                <span class="ui-status-icon"></span>
                <xsl:choose>
                    <xsl:when test="@type='test-case' or (@type='smart-folder' and @type!='iteration-container' and @activity-exectype='dataiteration')">Iteration: </xsl:when>
                    <xsl:otherwise>Repeat: </xsl:otherwise>
                </xsl:choose>
                <xsl:value-of select="./@iteration" />
				<xsl:value-of select="./datarow/field" />
                <xsl:if test=".//item[@level='Warn']">
                    <span class="ui-module-icon warn"></span>
                </xsl:if>
                <xsl:if test=".//item[@level='Error']">
                    <span class="ui-module-icon error"></span>
                </xsl:if>
                <span class="duration">
                    <xsl:value-of select="./@duration" />
                </span>
            </h2>
            <ul>
                <xsl:if test="./datarow/field">
                    <div class="datarow">
                        <xsl:apply-templates select="./datarow" />
                    </div>
                </xsl:if>

                <xsl:if test="$loadAll = 1">
                    <xsl:apply-templates select="./activity">
                        <xsl:with-param name="itemCount" select="$itemCount" />
                    </xsl:apply-templates>
                </xsl:if>
            </ul>
        </li>
    </xsl:template>
Pavel Kudrys
Ranorex explorer at Descartes Systems

Please add these details to your questions:
  • Ranorex Snapshot. Learn how to create one >here<
  • Ranorex xPath of problematic element(s)
  • Ranorex version
  • OS version
  • HW configuration

houseofcutler
Posts: 52
Joined: Fri Mar 21, 2014 4:22 pm

Re: Custom Report Examples

Post by houseofcutler » Mon Feb 12, 2018 5:40 pm

@odklizec Thank you so much for posting this. Many moons ago I had given up on finding a way to include data items in the Iteration headers, today I had a quick search and found your post. Even though I don't really understand XSL a bit of trial and error got me to the result I wanted. Iteration: N [data item 1] [data item 2]

User avatar
odklizec
Ranorex Guru
Ranorex Guru
Posts: 3922
Joined: Mon Aug 13, 2012 9:54 am
Location: Zilina, Slovakia

Re: Custom Report Examples

Post by odklizec » Tue Feb 13, 2018 1:31 pm

Hi, you are welcome. I'm glad my example helped you ;)
Pavel Kudrys
Ranorex explorer at Descartes Systems

Please add these details to your questions:
  • Ranorex Snapshot. Learn how to create one >here<
  • Ranorex xPath of problematic element(s)
  • Ranorex version
  • OS version
  • HW configuration