Continuous Integration - Jenkins not invoking WedDriver test

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

Continuous Integration - Jenkins not invoking WedDriver test

frass
Hi, I'm trying to use jenkins to run selenium webdriver test (continuous integration) but so far I've had no success at all. My setup:
- eclipse
- testng
- ant (build.xml files)
- jenkins
- everything is hosted locally
I'm running my test in parallel (1 test, 3 browsers) and this works fine if I run the testng file, if I run the ant file (build.xml) it says 'build successful' but nothing happens if also run this same file in jenkins it says the same thing 'build successful' but again nothing happens.  From this I can deduce that jenkins is running the correct file but its just not executing the test.  I've even tried to use maven but I don't understand it so the code doesn't even compile when I take this route.
Can someone help me and point me in the right direction because I believe I'm missing something.  I've included a photo of my jenkins set and below is a copy of my ant file:

<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<project basedir="." default="build" name="jenkins_run_selenium">
    <property environment="env"/>
    <property name="ECLIPSE_HOME" value="../../../Program Files (x86)/eclipse-standard-kepler-R-win32-x86_64/Eclipse"/>
    <property name="junit.output.dir" value="junit"/>
    <property name="debuglevel" value="source,lines,vars"/>
    <property name="target" value="1.7"/>
    <property name="source" value="1.7"/>
    <path id="jenkins_run_selenium.classpath">
        <pathelement location="bin"/>
        <pathelement location="../../../Program Files (x86)/Eclipse/selenium-2.40.0/selenium-java-2.40.0-srcs.jar"/>
        <pathelement location="../../../Program Files (x86)/Eclipse/selenium-2.40.0/selenium-server-standalone-2.40.0.jar"/>
        <pathelement location="../Desktop/Jar Files and Sources/testng-6.8.5-javadoc.jar"/>
        <pathelement location="../Desktop/Jar Files and Sources/testng-6.8.jar"/>
    </path>
    <target name="init">
        <mkdir dir="bin"/>
        <copy includeemptydirs="false" todir="bin">
            <fileset dir="src">
                <exclude name="**/*.launch"/>
                <exclude name="**/*.java"/>
            </fileset>
        </copy>
    </target>
    <target name="clean">
        <delete dir="bin"/>
    </target>
    <target depends="clean" name="cleanall"/>
    <target depends="build-subprojects,build-project" name="build"/>
    <target name="build-subprojects"/>
    <target depends="init" name="build-project">
        <echo message="${ant.project.name}: ${ant.file}"/>
        <javac debug="true" debuglevel="${debuglevel}" destdir="bin" includeantruntime="false" source="${source}" target="${target}">
            <src path="src"/>
            <classpath refid="jenkins_run_selenium.classpath"/>
        </javac>
    </target>
    <target description="Build all projects which reference this project. Useful to propagate changes." name="build-refprojects"/>
    <target description="copy Eclipse compiler jars to ant lib directory" name="init-eclipse-compiler">
        <copy todir="${ant.library.dir}">
            <fileset dir="${ECLIPSE_HOME}/plugins" includes="org.eclipse.jdt.core_*.jar"/>
        </copy>
        <unzip dest="${ant.library.dir}">
            <patternset includes="jdtCompilerAdapter.jar"/>
            <fileset dir="${ECLIPSE_HOME}/plugins" includes="org.eclipse.jdt.core_*.jar"/>
        </unzip>
    </target>
    <target description="compile project with Eclipse compiler" name="build-eclipse-compiler">
        <property name="build.compiler" value="org.eclipse.jdt.core.JDTCompilerAdapter"/>
        <antcall target="build"/>
    </target>
    <target name="jenkins_run_selenium">
        <mkdir dir="${junit.output.dir}"/>
        <junit fork="yes" printsummary="withOutAndErr">
            <formatter type="xml"/>
            <classpath refid="jenkins_run_selenium.classpath"/>
        </junit>
    </target>
    <target name="junitreport">
        <junitreport todir="${junit.output.dir}">
            <fileset dir="${junit.output.dir}">
                <include name="TEST-*.xml"/>
            </fileset>
            <report format="frames" todir="${junit.output.dir}"/>
        </junitreport>
    </target>
</project>

Reply | Threaded
Open this post in threaded view
|

Re: Continuous Integration - Jenkins not invoking WedDriver test

softwaretestingforum
Administrator
is jenkinss_run_selenium correct target?
~ seleniumtests.com
Reply | Threaded
Open this post in threaded view
|

Re: Continuous Integration - Jenkins not invoking WedDriver test

frass
jenkins_run_selenium is the name of my java project so I'm assuming this is the right target but I can't be sure I'm doing the right thing because I don't have extensive experience with Ant so to put it all into perspective:
project name - jenkins_run_selenium
testng file - TestingNg.xml
Ant file- build.xml
My code is the same for the tutorial you did (I think it's the third one) where you showed how to run test in parallel.