Trying to run a pack of selenium tests written in java using Jenkins -
Trying to run a pack of selenium tests written in java using Jenkins -
after reading posts suggests under "questions similar titles" (i go on reading after sending post) , reading
centripetal.ca/blog/2011/02/07/getting-started-with-selenium-and-jenkins/ oliverpolden.com/content/setting-automated-selenium-testing-jenkinshudsonand other posts (i note these 2 because think may useful someone) haven't found reply need. , that:
i'm working in company uses jenkins ci , maven. have 3 types of tests ran sotware: junit, cactus , selenium. jenkins has job run junit tests. they've decided run other 2 types of tests (cactus , selenium) using jenkins. , that's task. cactus question i'll inquire later (have been banging head 1 long right now). selenium tests written in java , there's java file has tests follows:
package com.mycompany.test.dailysanity; import org.junit.runner.runwith; import org.junit.runners.suite; @runwith(suite.class) @suite.suiteclasses({ test1.class, test2.class, test3.class, }) public class alltests { /** * place holder. * add together testclass 1 list above. * note, testclasses should "," separated */ }
all info i've found talks htmlsuite, nil if tests in java (no, exporting them html not option). i've tried
export display=":99" && java -jar /path/to/selenium-server.jar -browsersessionreuse -htmlsuite *firefox http://localhost /path/to/my/testsfile/alltests.java /path/to/my/logfile/seleniumlog.html
as "execute shell" in "build" step in jenkins job, stays trying something. console output
09:29:48.508 info - java: sun microsystems inc. 14.2-b01 09:29:48.518 info - os: linux 2.6.18.8-xenu amd64 09:29:48.654 info - v2.4.0, core v2.4.0. built revision 13337 09:29:49.263 info - remotewebdriver instances should connect to: http://127.0.0.1:4444/wd/hub 09:29:49.264 info - version jetty/5.1.x 09:29:49.269 info - started httpcontext[/selenium-server/driver,/selenium-server/driver] 09:29:49.271 info - started httpcontext[/selenium-server,/selenium-server] 09:29:49.271 info - started httpcontext[/,/] 09:29:49.337 info - started org.openqa.jetty.jetty.servlet.servlethandler@7a187814 09:29:49.337 info - started httpcontext[/wd,/wd] 09:29:49.343 info - started socketlistener on 0.0.0.0:4444 09:29:49.343 info - started org.openqa.jetty.jetty.server@67ad77a7 10:51:00.038 info - shutting down... 10:51:00.040 info - stopping acceptor serversocket[addr=0.0.0.0/0.0.0.0,port=0,localport=4444]
i assume nil else (waited 2 hours before aboting it) beacause it's java file , requires html file (-htmlsuite clue).
to sum up: need way run selenium tests written in java , packaged in java suite on jenkins.
editing ok, i'm not getting anywhere , running out of time. i'm adding more info in case can give me hand (not i'm not thankful ross). here goes selenium_pom.xml:
<project xmlns="http://maven.apache.org/pom/4.0.0" xmlns:xsi="http://www.w3.org/2001/xmlschema-instance" xsi:schemalocation="http://maven.apache.org/pom/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd"> <modelversion>4.0.0</modelversion> <groupid>my.company</groupid> <artifactid>selenium-test</artifactid> <version>0.1-snapshot</version> <dependencies> <dependency> <groupid>junit</groupid> <artifactid>junit</artifactid> <version>3.8.2</version> <scope>test</scope> </dependency> <dependency> <groupid>org.seleniumhq.selenium.client-drivers</groupid> <artifactid>selenium-java-client-driver</artifactid> <version>1.0.1</version> <scope>test</scope> </dependency> </dependencies> <build> <plugins> <plugin> <groupid>org.codehaus.mojo</groupid> <artifactid>selenium-maven-plugin</artifactid> <version>2.1</version> <executions> <execution> <phase>pre-integration-test</phase> <goals> <goal>start-server</goal> </goals> <configuration> <background>true</background> </configuration> </execution> </executions> </plugin> <plugin> <groupid>org.apache.maven.plugins</groupid> <artifactid>maven-surefire-plugin</artifactid> <configuration> <!-- skip normal tests, we'll run them in integration-test phase --> <skip>true</skip> </configuration> <executions> <execution> <phase>integration-test</phase> <goals> <goal>test</goal> </goals> <configuration> <skip>false</skip> <includes> <include>/path/to/my/tests/alltests.java</include> </includes> </configuration> </execution> </executions> </plugin> </plugins> </build> </project>
when run
mvn -f selenium_pom.xml integration-test
i next output
[info] scanning projects... [warning] [warning] problems encountered while building effective model com.kana.sem:selenium-test:jar:0.1-snapshot [warning] 'build.plugins.plugin.version' org.apache.maven.plugins:maven-surefire-plugin missing. @ line 44, column 21 [warning] [warning] highly recommended prepare these problems because threaten stability of build. [warning] [warning] reason, future maven versions might no longer back upwards building such malformed projects. [warning] [info] [info] ------------------------------------------------------------------------ [info] building selenium-test 0.1-snapshot [info] ------------------------------------------------------------------------ [info] [info] --- maven-resources-plugin:2.4.3:resources (default-resources) @ selenium-test --- [warning] using platform encoding (utf-8 actually) re-create filtered resources, i.e. build platform dependent! [info] skip non existing resourcedirectory /path/to/main/resources [info] [info] --- maven-compiler-plugin:2.3.2:compile (default-compile) @ selenium-test --- [info] no sources compile [info] [info] --- maven-resources-plugin:2.4.3:testresources (default-testresources) @ selenium-test --- [warning] using platform encoding (utf-8 actually) re-create filtered resources, i.e. build platform dependent! [info] skip non existing resourcedirectory /path/to/resources/resources [info] [info] --- maven-compiler-plugin:2.3.2:testcompile (default-testcompile) @ selenium-test --- [info] no sources compile [info] [info] --- maven-surefire-plugin:2.7.2:test (default-test) @ selenium-test --- [info] tests skipped. [info] [info] --- maven-jar-plugin:2.3.1:jar (default-jar) @ selenium-test --- [warning] jar empty - no content marked inclusion! [info] [info] --- selenium-maven-plugin:2.1:start-server (default) @ selenium-test --- launching selenium server waiting selenium server... [warning] os appears unix , no display environment variable has been detected. browser maybe unable function correctly. consider using selenium:xvfb goal enable headless operation. [info] user extensions: /localhome/kana/p4/dev/bot/target/selenium/user-extensions.js 08:05:07,166 info [org.openqa.selenium.server.seleniumserver] java: ibm corporation 2.3 08:05:07,173 info [org.openqa.selenium.server.seleniumserver] os: linux 2.6.18.8-xenu x86 08:05:07,184 info [org.openqa.selenium.server.seleniumserver] v2.9.0, core v2.9.0. built revision 14289 08:05:07,273 info [org.openqa.selenium.server.seleniumserver] remotewebdriver instances should connect to: http://127.0.0.1:4444/wd/hub 08:05:07,277 info [org.openqa.jetty.http.httpserver] version jetty/5.1.x 08:05:07,686 info [org.openqa.jetty.util.container] started org.openqa.jetty.jetty.servlet.servlethandler@51fe51fe 08:05:07,687 info [org.openqa.jetty.util.container] started httpcontext[/wd,/wd] 08:05:07,687 info [org.openqa.jetty.util.container] started httpcontext[/,/] 08:05:07,688 info [org.openqa.jetty.util.container] started httpcontext[/selenium-server,/selenium-server] 08:05:07,689 info [org.openqa.jetty.util.container] started httpcontext[/selenium-server/driver,/selenium-server/driver] 08:05:07,705 info [org.openqa.jetty.http.socketlistener] started socketlistener on 0.0.0.0:4444 08:05:07,705 info [org.openqa.jetty.util.container] started org.openqa.jetty.jetty.server@40e640e6 08:05:07.916 info - checking resource aliases selenium server started [info] [info] --- maven-surefire-plugin:2.7.2:test (default) @ selenium-test --- [info] no tests run. [info] surefire study directory: /path/to/surefire-reports/surefire-reports ------------------------------------------------------- t e s t s ------------------------------------------------------- there no tests run. results : tests run: 0, failures: 0, errors: 0, skipped: 0 [info] ------------------------------------------------------------------------ [info] build success [info] ------------------------------------------------------------------------ [info] total time: 30.387s [info] finished at: fri jan 13 08:05:08 cst 2012 [info] final memory: 12m/30m [info] ------------------------------------------------------------------------
i'm using perforce, jenkins, maven3 , reddish hat enterprise linux server release 5.5 (tikanga). i'm sure pom 1 of problems, got net samples...
thanks (and congratulations have finished reading post!)
ps: if know how study selenium tests great.
the -htmlsuite
alternative different you're trying do. don't allow distract :-)
your java code appears written tests executed via junit. that's mutual technique. expect need create sure selenium rc server running before tests begin. java -jar /path/to/selenium-server.jar
, leave running until @ to the lowest degree end of lastly test. tests contact server creating connection it, calling new defaultselenium(...)
.
selenium selenium-grid
Comments
Post a Comment