When I followed this link LINK to generate XSLT Report Using testng and to send email reports getting error message (Ex: package org.openqa.seleni um does not exist, etc...0).

Please suggest me.

build.xml code is:

<project name="XSLT" default="sendMail" basedir=".">
<!-- Defining property -->
    <property name="project.dir" value="${basedir}"/>
    <property name="build.dir" value="${basedir}/build"/>
    <property name="jar.dir" value="${basedir}/Lib"/>
    <property name="src.dir" value="${basedir}/src"/>
    <property name="ng.result" value="test-output"/>

    <!-- Setting Classpath for jar files -->
    <target name="setClassPath">
    <path id="classpath_jars">
    <pathelement path="${basedir}/" />
    <fileset dir="${jar.dir}">
    <include name="*.jar"/>
    <pathconvert pathsep=":" property="test.classpath" refid="classpath_jars" />

    <!-- Loading Testng 
    <target name="loadTestNG" depends="setClassPath" >
    <taskdef resource="testngtasks" classpath="${test.classpath}"/>
    </target> -->
    <!--  Deleting directories -->

    <target name="clean">
    <echo message="deleting existing build directory"/>
    <delete dir="${build.dir}"/>
    <!--  Creating build folder to store compiled classes -->
    <target name="init" depends="clean,setClassPath">
    <mkdir dir="${build.dir}"/>

    <!-- Compiling java files -->
    <target name="compile" depends="clean,init,setClassPath">
    <echo message=""/>
    <echo message="compiling………."/>

    <target name="run" depends="compile">
    <testng classpath="${test.classpath}:${build.dir}">
    <xmlfileset dir="${basedir}" includes="testng.xml"/>

    <!--  adding XSLT report target to produce XSLT report -->
    <target name="makexsltreports" depends="run">
    <delete dir="${project.dir}/XSLT_Reports/output">
    <mkdir dir="${project.dir}/XSLT_Reports/output"/>
    <xslt in="${ng.result}/testng-results.xml" style="/MFW/XSLT/testng-results.xsl" out="${project.dir}/XSLT_Reports/output/index.html" classpathref="classpath_jars" processor="SaxonLiaison">
    <param name="testNgXslt.outputDir" expression="${project.dir}/XSLT_Reports/output/"/><param name="testNgXslt.showRuntimeTotals" expression="true"/>
    <param expression="true" name="testNgXslt.sortTestCaseLinks" />
    <param expression="FAIL,SKIP,PASS,CONF,BY_CLASS" name="testNgXslt.testDetailsFilter" />

    <!--  using javax.mail.jar and javax.activation.jar trying to send report as zip file -->
    <target name="sendMail" depends="makexsltreports">
    <zip destfile="${project.dir}/XSLT_Reports/output.zip" basedir="${project.dir}/XSLT_Reports/output" />
    tolist="[email protected]"
    from="[email protected]"
    subject="Email subject"
    ssl = "true"
    user="[email protected]"
    <fileset dir="${project.dir}/XSLT_Reports/">
    <include name="**/*.zip"/>


D:\MFW\XSLT>ant makexsltreports
Buildfile: D:\MFW\XSLT\build.xml

     [echo] deleting existing build directory
   [delete] Deleting directory D:\MFW\XSLT\build


    [mkdir] Created dir: D:\MFW\XSLT\build

     [echo] compilingààà.
    [javac] Compiling 1 source file to D:\MFW\XSLT\build
    [javac] D:\MFW\XSLT\src\spk\Testing.java:3: error: package org.openqa.seleni
um does not exist
    [javac] import org.openqa.selenium.WebDriver;
    [javac]                           ^
    [javac] D:\MFW\XSLT\src\spk\Testing.java:4: error: package org.openqa.seleni
um.firefox does not exist
    [javac] import org.openqa.selenium.firefox.FirefoxDriver;
    [javac]                                   ^
    [javac] D:\MFW\XSLT\src\spk\Testing.java:5: error: package org.testng.annota
tions does not exist
    [javac] import org.testng.annotations.Test;
    [javac]                              ^
    [javac] D:\MFW\XSLT\src\spk\Testing.java:9: error: cannot find symbol
    [javac]     @Test
    [javac]      ^
    [javac]   symbol:   class Test
    [javac]   location: class Testing
    [javac] D:\MFW\XSLT\src\spk\Testing.java:11: error: cannot find symbol
    [javac]             WebDriver d = new FirefoxDriver();
    [javac]             ^
    [javac]   symbol:   class WebDriver
    [javac]   location: class Testing
    [javac] D:\MFW\XSLT\src\spk\Testing.java:11: error: cannot find symbol
    [javac]             WebDriver d = new FirefoxDriver();
    [javac]                               ^
    [javac]   symbol:   class FirefoxDriver
    [javac]   location: class Testing
    [javac] 6 errors

D:\MFW\XSLT\build.xml:47: Compile failed; see the compiler error output for deta

Total time: 1 second

Folder Structure:

Folder Structure


package spk;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.firefox.FirefoxDriver;
import org.testng.annotations.Test;

public class Testing {
    public void test() {
        WebDriver driver = new FirefoxDriver();

2 Answers 2


Please use below xml file and from command prompt go to project location and run as "ant generateReport" (Should have ANT). Let me know if you have any questions.

.xml file:

<project name="TestAutomation" basedir=".">
    <property name="LIB" value="${basedir}/lib" />
    <property name="BIN" value="${basedir}/bin" />
    <path id="master-classpath">
        <pathelement location="${BIN}" />
        <fileset dir="${LIB}" includes="*.jar"/>
    <target name="generateReport">
        <delete dir="${basedir}/testng-xslt">
        <mkdir dir="${basedir}/testng-xslt">
        <xslt in="${basedir}/test-output/testng-results.xml" style="${basedir}/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">

Selenium standalone jar and testNg jars are missing . So just keep these jars in you Lib folder and this will resolve your problem.

Since in build.xml you have provided jar location to lib folder. So please keep all your jar files in lib folder and this will start working without showing any error.

Good Luck

  • Abodeqa is this something that can be mavenized?
    – corsiKa
    Apr 17, 2015 at 16:26

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.