Thursday, March 27, 2014

Some Error and Solution For TestNG-XSLT


On our previous post we learn how to configure and generate different type of repot using TestNG XSLT. Now here we discuss some configuration related problem and how can we overcome this.

Problem 1:

Error! Syntax error in 'if ($testNgXslt.testDetailsFilter) then $testNgXslt.testDetailsFilter else 'FAIL,PASS,SKIP''

Solution: 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">

Problem 2:

Fatal Error! Failed to create output file file://///style.css Cause: java.io.IOException: The filename, directory name, or volume label syntax is incorrect

Solution: This error happen if we for get to mentioned <param expression="${basedir}/testng-xslt/" name="testNgXslt.outputDir" /> this is mandatory and must be an absolute path.This is mandatory and must be an absolute path.
 

1 comment:

  1. Thanks for posting this solution. stucked with Problem 2 for hours and found solution here . even after adding the param i was getting same error , again checked ur solution ...."must be an absoute path " saved the day...Thanks ..Keep sharing

    ReplyDelete