i

Selenium Step By Step Guide

TestNG XSLT Jar, Build.xml & TestNG.xml file

TestNG XSLT Jar:

I have put the TestNG XSLT jar on my google drive link here. For creating the XSLT reporting. Let us download the files and paste them in the project directory. Now let us create a TestNG class.

Copy XSLT files into your Project:

Now Run the TestNG Project:

Let us now run the TestNG test from eclipse:

 

Create a TestNG.xml:

We can also generate the testing.xml from the TestNG suite. Follow the below steps to generate the testing.xml:

  1. Select the TestNG class and right-click on the same. Below option grid opens:

 

  1. Select “Convert to TestNG” and click on the finish button.

  1. “testing.xml” file gets created in the Project directory.

Run the build.xml

Now we need to run the build.xml file. A sample of build.xml looks like this:

name="TestAutomation" basedir=".">

    name="LIB" value="${basedir}/lib" />

    name="BIN" value="${basedir}/bin" />

    id="master-classpath">

        location="${BIN}" />

        dir="${LIB}" includes="*.jar"/>

   

    name="generateReport">

        dir="${basedir}/testng-xslt">

       

        dir="${basedir}/testng-xslt">

       

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

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

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

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

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

            refid="master-classpath">

           

       

   

 

Now run the build.xml as “Ant Build”.

Once build gets successful, it will generate the output files under “testing-XSLT" folder for the XSLT reports as shown below:

 

Click in the index.html file in the "testing-XSLT" folder. XSLT report gets displayed in the web browser.