Generate XSLT Report+ Ant build.xml+ Resolving Unknown file:23:146: Fatal Error! Could not find function: if Issue +No suites, classes, methods or jar file was specified
We usually depend on Testng for generating the default reports. Apart from that we use XSLT reports as well to generate PIE Charts based on Failed,Passed,Skipped Testcases.
During this process we face lot of issues. Few of the most commonly observed issues are as follows:
[xslt] Unknown file:23:146: Fatal Error! Could not find function: if
[xslt] : Fatal Error! Fatal error during transformation Cause: Fatal error during transformation
In order to resolve this we have to follow the below steps. At every step we will check and see whether issues are resolved or not.
Step 1 :
Make sure the build.xml file contains 'SaxonLiaison' processor added.
Example:<xslt in="${outputdir}/test-output/testng-results.xml" style="${basedir}/testng-results.xsl" out="${outputdir}/testng-xslt/index.html" processor="SaxonLiaison">
Re-run the build.xml and verify the issue is resolved. If the issue is not resolved goto Step2.
Step 2 :
Make sure the following jars added to the lib folder and Project build path as well.
guice-3.0.jar->Link to download guice-3.0.jar->Click here
Re-run the build.xml and verify the issue is resolved. If the issue is not resolved goto Step3.
Step 3:
Re-verify the build.xml available in the project directory by downloading from this link Click here .Try to do necessary changes.
Re-run the build.xml and verify the issue is resolved. If the issue is not resolved goto Step3.
Re-verify the build.xml available in the project directory by downloading from this link Click here .Try to do necessary changes.
Re-run the build.xml and verify the issue is resolved. If the issue is not resolved goto Step3.
Step 4:
Re-verify the testng-results.xsl available in the project directory by downloading from the link Click here.Try to do necessary changes.
Re-run the build.xml and verify all the issues are resolved.
Re-run the build.xml and verify all the issues are resolved.
If even after the issues are not resolved, please refer to the directory structure mentioned in the below screenshot.
Resolving "No suites, classes, methods or jar file was specified" in Ant TestNG- Make sure the testng.xml is availble in the src folder as mentioned in the image below. Refer to the point1.