- shweta.bet
- Posts : 7
Join date : 2014-11-14
Age : 42
Ant build file for TestNG not running
Fri Nov 14, 2014 3:52 pm
Hi,
I m using Ant Build.xml for TestNG.xml to run testng with ANT.
My Build.xml looks like this..
and after running this build file..
Buildfile: D:\OllehSpace\Ktele\build.xml
ktele:
[javac] D:\OllehSpace\Ktele\build.xml:20: warning: 'includeantruntime' was not set, defaulting to build.sysclasspath=last; set to false for repeatable builds
runTest:
[testng] Usage: [options] The XML suite files to run
[testng] Options:
[testng] -configfailurepolicy Configuration failure policy (skip or
[testng] continue)
[testng] -d Output directory
[testng] -dataproviderthreadcount Number of threads to use when running
[testng] data providers
[testng] -excludegroups Comma-separated list of group names to
[testng] exclude
[testng] -groups Comma-separated list of group names to be
[testng] run
[testng] -junit JUnit mode
[testng] Default: false
[testng] -listener List of .class files or list of class
[testng] names implementing ITestListener or
[testng] ISuiteListener
[testng] -methods Comma separated of test methods
[testng] Default: []
[testng] -methodselectors List of .class files or list of class
[testng] names implementing IMethodSelector
[testng] -mixed Mixed mode - autodetect the type of
[testng] current test and run it with appropriate runner
[testng] Default: false
[testng] -objectfactory List of .class files or list of class
[testng] names implementing ITestRunnerFactory
[testng] -parallel Parallel mode (methods, tests or classes)
[testng] -port The port
[testng] -reporter Extended configuration for custom report
[testng] listener
[testng] -suitename Default name of test suite, if not
[testng] specified in suite definition file or source code
[testng] -suitethreadpoolsize Size of the thread pool to use to run
[testng] suites
[testng] Default: 1
[testng] -testclass The list of test classes
[testng] -testjar A jar file containing the tests
[testng] -testname Default name of test, if not specified in
[testng] suitedefinition file or source code
[testng] -testnames The list of test names to run
[testng] -testrunfactory, -testRunFactory The factory used to create tests
[testng] -threadcount Number of threads to use when running
[testng] tests in parallel
[testng] -usedefaultlisteners Whether to use the default listeners
[testng] Default: true
[testng] -log, -verbose Level of verbosity
[testng] -xmlpathinjar The full path to the xml file inside the
[testng] jar file (only valid if -testjar was
[testng] specified)
[testng] Default: testng.xml
[testng] Unknown option: -d D:\OllehSpace\Ktele\test-output -sourcedir D:\OllehSpace\Ktele\bin -suitename "Ant suite" -testname "Ant test" "D:\OllehSpace\Ktele\TestNG.xml"
BUILD SUCCESSFUL
Total time: 2 seconds
I will get BUILD succes msg but script inside TestNg.xml are not running.
Can anyone help me ?
I m using Ant Build.xml for TestNG.xml to run testng with ANT.
My Build.xml looks like this..
- Code:
<?xml version="1.0" encoding="UTF-8" ?>
<project name="ANT File For TestNG" default="runTest"
basedir=".">
<property name="src" location="src" />
<property name="bin" location="bin" />
<property name="lib" location="D:\\Reference Library"
/>
<path id="class.path">
<pathelement
location="${lib}/selenium-server-standalone-2.43.1.jar" />
<pathelement location="${lib}/testng-5.5.jar" />
<pathelement location="${lib}/ReportNG/guice-3.0.jar"
/>
<pathelement location="${lib}/ReportNG/reportng-1.1.2"
/>
<pathelement location="${lib}/ReportNG/velocity-dep-1.4"
/>
<pathelement location="${lib}/ojdbc6_g.jar" />
<pathelement location="${bin}" />
</path>
<target name="ktele">
<mkdir dir="${bin}"/>
<javac classpathref="class.path" destdir="${bin}"
encoding="UTF-8" srcdir="${src}"/>
</target>
<taskdef name="testng" classname="org.testng.TestNGAntTask">
<classpath>
<pathelement location="${lib}/testng-5.5.jar"
/>
</classpath>
</taskdef>
<target name="runTest" depends="ktele">
<testng outputdir="test-output" classpathref="class.path"
sourceDir="${bin}">
<xmlfileset dir="." includes="TestNG.xml" />
</testng>
</target>
</project>
and after running this build file..
Buildfile: D:\OllehSpace\Ktele\build.xml
ktele:
[javac] D:\OllehSpace\Ktele\build.xml:20: warning: 'includeantruntime' was not set, defaulting to build.sysclasspath=last; set to false for repeatable builds
runTest:
[testng] Usage:
[testng] Options:
[testng] -configfailurepolicy Configuration failure policy (skip or
[testng] continue)
[testng] -d Output directory
[testng] -dataproviderthreadcount Number of threads to use when running
[testng] data providers
[testng] -excludegroups Comma-separated list of group names to
[testng] exclude
[testng] -groups Comma-separated list of group names to be
[testng] run
[testng] -junit JUnit mode
[testng] Default: false
[testng] -listener List of .class files or list of class
[testng] names implementing ITestListener or
[testng] ISuiteListener
[testng] -methods Comma separated of test methods
[testng] Default: []
[testng] -methodselectors List of .class files or list of class
[testng] names implementing IMethodSelector
[testng] -mixed Mixed mode - autodetect the type of
[testng] current test and run it with appropriate runner
[testng] Default: false
[testng] -objectfactory List of .class files or list of class
[testng] names implementing ITestRunnerFactory
[testng] -parallel Parallel mode (methods, tests or classes)
[testng] -port The port
[testng] -reporter Extended configuration for custom report
[testng] listener
[testng] -suitename Default name of test suite, if not
[testng] specified in suite definition file or source code
[testng] -suitethreadpoolsize Size of the thread pool to use to run
[testng] suites
[testng] Default: 1
[testng] -testclass The list of test classes
[testng] -testjar A jar file containing the tests
[testng] -testname Default name of test, if not specified in
[testng] suitedefinition file or source code
[testng] -testnames The list of test names to run
[testng] -testrunfactory, -testRunFactory The factory used to create tests
[testng] -threadcount Number of threads to use when running
[testng] tests in parallel
[testng] -usedefaultlisteners Whether to use the default listeners
[testng] Default: true
[testng] -log, -verbose Level of verbosity
[testng] -xmlpathinjar The full path to the xml file inside the
[testng] jar file (only valid if -testjar was
[testng] specified)
[testng] Default: testng.xml
[testng] Unknown option: -d D:\OllehSpace\Ktele\test-output -sourcedir D:\OllehSpace\Ktele\bin -suitename "Ant suite" -testname "Ant test" "D:\OllehSpace\Ktele\TestNG.xml"
BUILD SUCCESSFUL
Total time: 2 seconds
I will get BUILD succes msg but script inside TestNg.xml are not running.
Can anyone help me ?
Permissions in this forum:
You cannot reply to topics in this forum