I can’t help with any of these issues as I don’t know how the build.xml works. 
Just how to use it when eclipse creates it.

From: [email protected] 
[mailto:[email protected]] On Behalf Of Raghavendra Pise
Sent: Sunday, April 05, 2015 1:33 AM
To: [email protected]
Subject: Re: Jenkins Job Setup - Test Script Execution using Selenium Web 
Driver and Testng pluin in Eclipse IDE

Thank you very much for your information.

I have started writing a build.xml and I found some hint how to write build.xml 
from following post.

http://stackoverflow.com/questions/16782414/how-to-run-testng-tests-on-Jenkins<http://stackoverflow.com/questions/16782414/how-to-run-testng-tests-on-jenkins>

I have tweaked my code as per the requirement but I encountered few errors in 
Jenkins.

Please find below code snippet.

<project name="projectname" basedir="." default="runTest">

 <property name="src.dir" location="${basedir}/src/XcellentCare_Scripts" />
 <property name="lib.dir" location="${basedir}/lib" />
 <property name="exec.dir" location="${basedir}/exec" />
 <property name="exec.bin.dir" location="${exec.dir}/bin" />
 <property name="functional.base.dir" location="${basedir}/../../" />
 <property name="reports.dir" location="${exec.dir}/reports" />
 <property name="failure.dir" location="${exec.dir}/reports/xml" />

 <path id="ft.classpath">
 <fileset dir="${lib.dir}">
 <include name="*.jar" />
 </fileset>
 <pathelement location="${exec.dir}" />
 </path>
 <taskdef resource="testngtasks" classpath="${lib.dir}/testng.jar" />
 <target name="clean">
 <delete dir="${exec.dir}" />

 </target>
 <target name="prepare">
 <mkdir dir="${exec.dir}" />
 <mkdir dir="${reports.dir}/output" />
 <copy todir="${exec.bin.dir}">
 <fileset dir="${src.dir}" />
 </copy>
 </target>

 <target name="compile" depends="clean, prepare">
 <javac classpathref="ft.classpath" srcdir="${src.dir}" destdir="${exec.dir}" />
 </target>

 <target name="runTest" depends="compile">
 <testng classpathref="ft.classpath" outputdir="${reports.dir}/Test 1" 
suitename="suite1">
 <xmlfileset dir="${basedir}" includes="testng.xml"/>
 </testng>
 </target>

 </project>

And I am getting following error,

 [javac] E:\Philips\XC_RM_KT\Workspace\XcellentCare\build.xml:39: warning: 
'includeantruntime' was not set, defaulting to build.sysclasspath=last; set to 
false for repeatable builds
    [javac] Compiling 9 source files to 
E:\Philips\XC_RM_KT\Workspace\XcellentCare\exec
    [javac] 
E:\Philips\XC_RM_KT\Workspace\XcellentCare\src\XcellentCare_Scripts\SprintI.java:13:
 error: package XcellentCare_Library does not exist
    [javac] import XcellentCare_Library.Generic;
    [javac]                            ^
    [javac] 
E:\Philips\XC_RM_KT\Workspace\XcellentCare\src\XcellentCare_Scripts\SprintI.java:14:
 error: package XcellentCare_Library does not exist
    [javac] import XcellentCare_Library.SuperTestNG;
    [javac


Any how to add source code from XcellentCare_Library in build.xml target file.

Here I have code in below location.

E:\Philips\XC_RM_KT\Workspace\XcellentCare\src\XcellentCare_Scripts
E:\Philips\XC_RM_KT\Workspace\XcellentCare\src\XcellentCare_Pages
E:\Philips\XC_RM_KT\Workspace\XcellentCare\src\XcellentCare_Library

Thanks,
Raghu Pise


On Friday, April 3, 2015 at 5:49:48 PM UTC+5:30, rginga wrote:
The only way I know how to do this is to have Eclipse create an ANT build.xml 
file. Look under File->Export. Then I use these commands. The first one builds 
the tests the second runs them.

call "C:\apache-ant-1.9.4\bin\ant.bat" -file build.xml build
call "C:\apache-ant-1.9.4\bin\ant.bat" -file build.xml Suite1Runner


From: [email protected]<javascript:> 
[mailto:[email protected]<javascript:>] On Behalf Of Raghavendra Pise
Sent: Friday, April 03, 2015 2:12 AM
To: [email protected]<javascript:>
Subject: Jenkins Job Setup - Test Script Execution using Selenium Web Driver 
and Testng pluin in Eclipse IDE


Dear All,



We are using Eclipse IDE and Selenium Web driver for test automation project 
and we have test cases written in Java.



The test execution is happening through 'Testng Plugin' in Eclipse IDE and we 
have installed it.



We can able to run testng xml from Eclipse IDE and it will trigger 'testng xml' 
file and its working fine.



I would like to know whether we can able to trigger this xml through Windows 
Batch command in Jenkins Job.



Please share your opinion and kindly let me know if you need more clarification



Thanks,
Raghav

--
You received this message because you are subscribed to the Google Groups 
"Jenkins Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected]<javascript:>.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/jenkinsci-users/033dfbc6-9af3-4da9-b164-c44d7d268758%40googlegroups.com<https://groups.google.com/d/msgid/jenkinsci-users/033dfbc6-9af3-4da9-b164-c44d7d268758%40googlegroups.com?utm_medium=email&utm_source=footer>.
For more options, visit https://groups.google.com/d/optout.
--
You received this message because you are subscribed to the Google Groups 
"Jenkins Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to 
[email protected]<mailto:[email protected]>.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/jenkinsci-users/cab5fcb5-663a-4407-8913-5e5430c6da21%40googlegroups.com<https://groups.google.com/d/msgid/jenkinsci-users/cab5fcb5-663a-4407-8913-5e5430c6da21%40googlegroups.com?utm_medium=email&utm_source=footer>.
For more options, visit https://groups.google.com/d/optout.

-- 
You received this message because you are subscribed to the Google Groups 
"Jenkins Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/jenkinsci-users/6C6EE445A6F6CE4E8A0FFB51B071A4E26E51ADC5%40AMERMBX02.PERKINELMER.NET.
For more options, visit https://groups.google.com/d/optout.

Reply via email to