Čo sa zmenilo vo svete nástrojov na automatické testovanie webových aplikácií od tohto leta. Novinky a vylepšenia.
Ďalším vylepšením Canoo WebTest je rozšírenie reportov o zoznam pomaly sa zobrazujúcich stránok [server response]. Táto nová možnosť zatiaľ nie je súčasťou oficiálnej release - zatiaľ stále čaká na implementáciu v riadnej release. Ja však pre čitateľov tohto portálu uvádzam toto rozšírenie.
Implementuje sa v súbore:
/build/resources/WebTestReport.xsl
Do tohto súboru sa doplní šablóna/template "show-time-problems", ktorá na koniec každého WebTest reportu zobrazí tabuľku so zoznamom farebne rozlíšených stránok, ktorých zobrazenie v prehliadači trvalo viac ako 1500, 3000, 5000, 10000 milisekúnd.
<xsl:template name="show-time-problems">
<xsl:variable name="requestSteps"
select="//step[starts-with(@taskName, 'sqlunit') or
@taskName = 'invoke' or
@taskName = 'clickLink' or
@taskName = 'clickButton' or
@taskName = 'clickElement'][@result = 'completed' or
@result = 'failed']"/>
<table border="0">
<tr>
<th>Time</th>
<th>Action</th>
<th>Source Page</th>
<th>Result Page</th>
<th>Description</th>
</tr>
<xsl:for-each select="$requestSteps">
<xsl:if test="number(@duration)>1500">
<tr>
<xsl:attribute name="bgcolor">
<xsl:choose>
<xsl:when test="number(@duration)>10000">
<xsl:text>red</xsl:text>
</xsl:when>
<xsl:when test="number(@duration)>5000">
<xsl:text>pink</xsl:text>
</xsl:when>
<xsl:when test="number(@duration)>3000">
<xsl:text>orange</xsl:text>
</xsl:when>
<xsl:when test="number(@duration)>1500">
<xsl:text>yellow</xsl:text>
</xsl:when>
<xsl:otherwise>
<xsl:text>white</xsl:text>
</xsl:otherwise>
</xsl:choose>
</xsl:attribute>
<xsl:variable name="previous_step" select="position()-1"/>
<td>
<xsl:value-of select="@duration"/>
</td>
<td>
<xsl:value-of select="@taskName"/>
<xsl:choose>
<xsl:when test="@taskName='clickButton'">
<xsl:text>(</xsl:text>
<xsl:value-of select="parameter[@name='label']/@value"/>
<xsl:text>)</xsl:text>
</xsl:when>
<xsl:when test="@taskName='clickLink'">
<xsl:text>(</xsl:text>
<xsl:value-of select="parameter[@name='label']/@value"/>
<xsl:text>)</xsl:text>
</xsl:when>
<xsl:when test="@taskName='invoke'">
<xsl:text>(</xsl:text>
<xsl:value-of select="parameter[@name='url']/@value"/>
<xsl:text>)</xsl:text>
</xsl:when>
<xsl:otherwise>
<xsl:text>unknown</xsl:text>
</xsl:otherwise>
</xsl:choose>
</td>
<td>
<a target="_blank">
<xsl:attribute name="href">
<xsl:if test="$responses.dir">
<xsl:value-of select="$responses.dir"/>
<xsl:text>/</xsl:text>
</xsl:if>
<xsl:value-of select="$requestSteps[$previous_step]/resultFile/@name"/>
</xsl:attribute>
<xsl:value-of select="$requestSteps[$previous_step]/resultFile/@name"/>
</a>
</td>
<td>
<a target="_blank">
<xsl:attribute name="href">
<xsl:if test="$responses.dir">
<xsl:value-of select="$responses.dir"/>
<xsl:text>/</xsl:text>
</xsl:if>
<xsl:value-of select="resultFile/@name"/>
</xsl:attribute>
<xsl:value-of select="resultFile/@name"/>
</a>
</td>
<td>
<xsl:if test="@description">
<xsl:text> (</xsl:text>
<xsl:value-of select="@description"/>
<xsl:text>)</xsl:text>
</xsl:if>
<xsl:text>...</xsl:text>
<xsl:value-of select="@result"/>
</td>
</tr>
</xsl:if>
</xsl:for-each>
</table>
</xsl:template>
Potom sa ešte do časti <xsl:template match="/"> doplní volanie šablóny "show-time-problems"
<body onload="initExpandCollapse('expandPlus.png','expandMinus.png')">
<xsl:apply-templates select="//testresult"/>
<br/>
<div style="text-align: center">
<a href="{$indexTests}">Back to Test Report Overview</a>
</div>
<br/>
<br/>
<br/>
<h3>--------- List Of Slow Pages -------</h3>
<br/>
<div>
<xsl:call-template name="show-time-problems"/>
</div>
</body>
Týmto rozšírením sa opäť zvýši pridaná hodnota Canoo WebTestu. Zvýši sa o možnosť využiť ho aj ako nástroj na testy, ktorých výsledkom je analýza slabých miest aplikácií z pohľadu rýchlosti zobrazovania stránok/výkonu webovej aplikácie.
Príklady rozšírenia Canoo WebTest reportu o zoznam "pomalých stránok":

Upravený súbor WebTestReport.xsl si môžete stiahnuť priamo tu.
Nabudúce:
Neštandardné testy
Copyright © 2002 - 2012 Inet.sk, s. r. o.Všetky práva vyhradenéNeprešlo jazykovou úpravouISSN 1336-1899
Využívame kvalitný webhosting za rozumnú cenu od Webhosting Inet.sk