testNG XSLT report generation gets failed...

1,377 views
Skip to first unread message

Nipun

unread,
Nov 21, 2011, 2:44:20 AM11/21/11
to testng-users
hi guys,
I am trying to use testNG xslt to generate reports. I have the
testing.xml that executes my test suite and then have my build xml to
run the TestNG xslt report generation. so after running the
'testing.xml' from eclipse, i took the cmd and executed the build.xml
by calling the ant <targetname> command.
My build.xml to run the testNG xslt report is as follows:

<project name="IBESanityScenarios" basedir=".">
<property name="LIB" value="${basedir}/libs" />
<path id="master-classpath">
<pathelement location="${BIN}" />
<fileset dir="${LIB}">
<include name="**/*.jar" />
</fileset>
</path>
<target name="testng-xslt-report">
<delete dir="${basedir}/testng-xslt">
</delete>
<mkdir dir="${basedir}/testng-xslt">
</mkdir>
<xslt in="${basedir}/test-output/testng-results.xml"
style="${basedir}/src/xslt/testng-results.xsl"
out="${basedir}/testng-xslt/index.html">

<param expression="${basedir}/testng-xslt/"
name="testNgXslt.outputDir" />

<param expression="true"
name="testNgXslt.sortTestCaseLinks" />

<param expression="FAIL,SKIP,PASS,CONF,BY_CLASS"
name="testNgXslt.testDetailsFilter" />

<param expression="true"
name="testNgXslt.showRuntimeTotals" />

<classpath refid="master-classpath">
</classpath>
</xslt>
</target>
</project>

However, i am getting the following error while doing the build:

D:\SeleniumWorkSpace\IBESanityScenarios>ant testng-xslt-report
Buildfile: D:\SeleniumWorkSpace\IBESanityScenarios\build.xml

testng-xslt-report:
[delete] Deleting directory D:\SeleniumWorkSpace\IBESanityScenarios
\testng-xs
lt
[mkdir] Created dir: D:\SeleniumWorkSpace\IBESanityScenarios
\testng-xslt
[xslt] Processing D:\SeleniumWorkSpace\IBESanityScenarios\test-
output\testn
g-results.xml to D:\SeleniumWorkSpace\IBESanityScenarios\testng-xslt
\index.html
[xslt] Loading stylesheet D:\SeleniumWorkSpace\IBESanityScenarios
\src\xslt\
testng-results.xsl
[xslt] : Error! Syntax error in 'if
($testNgXslt.testDetailsFilter) then $t
estNgXslt.testDetailsFilter else 'FAIL,PASS,SKIP''.
[xslt] : Error! file:/D:/SeleniumWorkSpace/IBESanityScenarios/src/
xslt/test
ng-results.xsl: line 23: Error parsing XPath expression 'if
($testNgXslt.testDet
ailsFilter) then $testNgXslt.testDetailsFilter else 'FAIL,PASS,SKIP''.
[xslt] : Error! file:/D:/SeleniumWorkSpace/IBESanityScenarios/src/
xslt/test
ng-results.xsl: line 23: Required attribute 'select' is missing.
[xslt] : Error! file:/D:/SeleniumWorkSpace/IBESanityScenarios/src/
xslt/test
ng-results.xsl: line 1085: Error parsing XPath expression 'if
($totalCount > 0)
then format-number($passedCount div $totalCount, '###%') else '100%''.
[xslt] : Error! file:/D:/SeleniumWorkSpace/IBESanityScenarios/src/
xslt/test
ng-results.xsl: line 1085: Required attribute 'select' is missing.
[xslt] : Fatal Error! Could not compile stylesheet
[xslt] Failed to process D:\SeleniumWorkSpace\IBESanityScenarios
\test-outpu
t\testng-results.xml

BUILD FAILED
D:\SeleniumWorkSpace\IBESanityScenarios\build.xml:16: Fatal error
during transfo
rmation

Any idea why I am getting this?

Cédric Beust ♔

unread,
Nov 21, 2011, 11:02:53 AM11/21/11
to testng...@googlegroups.com
Hi,

I don't know what "TestNG XSLT" is, I don't think I can be of much help. The error message seems to be indicating a syntax error in your XSLT file, but that's about all I see.

-- 
Cédric





--
You received this message because you are subscribed to the Google Groups "testng-users" group.
To post to this group, send email to testng...@googlegroups.com.
To unsubscribe from this group, send email to testng-users...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/testng-users?hl=en.


Krishnan

unread,
Nov 22, 2011, 5:50:33 AM11/22/11
to testng-users
Something that I stumbled into : http://openwritings.net/public/testng/ant-build-using-testng-xslt

Thought of sharing this, for whatever it is worth !

SilkTest Trainer

unread,
Nov 8, 2013, 1:30:05 AM11/8/13
to testng...@googlegroups.com
Hi Nipun,

Not sure if the issue is resolved for you.

This will help for anyone looking for similar problem.
Check for saxon-8.7.jar and SaxonLiaison.jar in your lib folder.

you lib folder is located in ${basedir}/libs

    <property name="LIB" value="${basedir}/libs" />

Regards
Trainer

arjun ray

unread,
Mar 27, 2014, 1:23:51 PM3/27/14
to testng...@googlegroups.com

This error occur because we forget to add SaxonLiaison jar into our project or we forget to add processor="SaxonLiaison" as an attribute on <xslt> tag. Proper tag is given below.

<xslt in="${basedir}/build/test/results/testng-results.xml" style="${basedir}/testng-results.xsl" out="${basedir}/testng-xslt/index.html" processor="SaxonLiaison">

For more details go to this blog : http://startingwithseleniumwebdriver.blogspot.in/2014/03/some-error-and-solution-for-testng-xslt.html

Sudheer Qa

unread,
May 26, 2015, 1:03:35 PM5/26/15
to testng...@googlegroups.com
The resolution for this issue is explained clearly in this blogger. 

Please have a look at it.. 

http://tobeanexpert.blogspot.in/2015/05/generate-xslt-report-ant-buildxml.html

I hope this will helps you.. 

Thanks, 
sudheer.
Reply all
Reply to author
Forward
0 new messages