Unable to generate the report using ANT | Selenium Training|Java|WebDriver|TestNG|Frameworks|Videos
10% December Month Discount - Avail now

Unable to generate the report using ANT

M
Post on 24/08/2015

Hi Ashish,

I was implement ANT with hybrid framework using Junit . I was successfully able to generate build folder and run the program but I was not able to generate the report in the desired report folder

So, after that I took 1 very small example and tried again and found that I am still not able to generate the report


Below is my simple java code

package com.qtpselenium.test;

import org.junit.Test;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.firefox.FirefoxDriver;

public class Testing {

public static void main(String[] args) {


WebDriver driver= new FirefoxDriver();
driver.get("https://www.gmail.com/intl/en/mail/help/about.html");
}

}




Below is my build.xml code


<?xml version="1.0" encoding="iso-8859-1"?>
<!DOCTYPE project [
]>

<project name="Test" default="usage" basedir=".">

<!-- ========== Initialize Properties =================================== -->
<property environment="env"/>

<property name="ws.home" value="${basedir}"/>
<property name="ws.jars" value="E:\Previous PC\Selenium\selenium-2.45.0\All jars"/>
<property name="test.dest" value="${ws.home}/build"/>
<property name="test.src" value="${ws.home}/src"/>
<property name="test.reportsDir" value="E:\Previous PC\Selenium\NewFinal\Test\Reports"/>



<path id="testcase.path">


<pathelement location="${test.dest}"/>

<fileset dir="${ws.jars}">
<include name="*.jar"/>
</fileset>

</path>


<!--target name="start-selenium-server">
<java jar="${ws.home}/lib/selenium-server.jar"/>
</target-->

<target name="setClassPath" unless="test.classpath">
<path id="classpath_jars">
<fileset dir="${ws.jars}" includes="*.jar"/>
</path>
<pathconvert pathsep=":"
property="test.classpath"
refid="classpath_jars"/>
</target>

<target name="init" depends="setClassPath">
<tstamp>
<format property="start.time" pattern="MM/dd/yyyy hh:mm aa" />
</tstamp>
<condition property="ANT"
value="${env.ANT_HOME}/bin/ant.bat"
else="${env.ANT_HOME}/bin/ant">
<os family="windows" />
</condition>

</target>

<!-- all -->
<target name="all">
</target>

<!-- clean -->
<target name="clean">
<delete dir="${test.dest}"/>
</target>

<!-- compile -->
<target name="compile" depends="init, clean" >
<delete includeemptydirs="true" quiet="true">
<fileset dir="${test.dest}" includes="**/*"/>
</delete>
<echo message="making directory..."/>
<mkdir dir="${test.dest}"/>
<echo message="classpath------: ${test.classpath}"/>
<echo message="compiling..."/>
<javac
debug="true"
destdir="${test.dest}"
srcdir="${test.src}"
target="1.5"
classpath="${test.classpath}"
>
</javac>
<copy todir="${test.dest}">
<fileset dir="${test.src}" excludes="**/*.java"/>
</copy>
</target>

<!-- build -->
<target name="build" depends="init">
</target>




<target name="usage">
<echo>
ant run will execute the test
</echo>
</target>

<path id="test.c">
<fileset dir="${ws.jars}" includes="*.jar"/>
</path>



<target name="run" >
<java classname="com.qtpselenium.test.Testing" classpath="${test.dest}" classpathref="testcase.path" />
</target>


<target name="report_email" >
<java classname="com.qtpselenium.util.ReportUtil" classpath="${test.dest}" classpathref="testcase.path" />
</target>





</project>

M
Reply on 24/08/2015

This is same as following issue:
http://qtpselenium.com/selenium-tutorial/forum/viewtopic.php?f=20&t=26

M
Reply on 26/08/2015

Hi Ashish,

My query is not same as "http://qtpselenium.com/selenium-tutorial/forum/viewtopic.php?f=20&t=26"

I am not able to generate the just the report. My code and everything works fine. After code runs , my report folder remains empty and i.e my issue

M
Reply on 28/08/2015

Hi

Please give me the soultion

M
Reply on 03/09/2015

Pleaase check my build.xml

<property name="test.reportsDir" value="E:\Previous PC\Selenium\NewFinal\Test\Reports"/>

is wrong
you need to give testng report dir

M
Reply on 04/09/2015

hi,
plz zip your project and upload it here.