html - How to Count XSL Nodes? -
i have nodes generated after automation run xsl file need count (testcases - passed , failed) in suite node structured appear in below image
this link have xsl file https://sites.google.com/site/feras13545646/report.xsl?attredirects=0&d=1
you need use count function within xsl file count number of nodes contain particular value, in case count how many times "pass" or "fail" appear.
example snippet below:
<table border='0' width='100%'> <tr><td><b>total tests passed:</b></td><td><xsl:value-of select="count(path/to/testresult[value = 'pass'])"/></td></tr> <tr><td><b>total tests failed:</b></td><td><xsl:value-of select="count(path/to/testresult[value = 'fail'])"/></td></tr> </table>
the main node in here below:
<xsl:value-of select="count(path/to/testresult[value = 'pass'])"/>
this specify value returned counting nodes in path "path/to/testresult" have value of pass.
Comments
Post a Comment