In Jenkins my job is of type "Build a maven2/3 project" and project name is "SeleniumProject" and project source is "SVN" contains around 40 test cases. When I build this, it runs all test cases and 3 of them fail. How can I execute an individual test in this project? These test cases are coming under module "automation". Where do I need to configure build to run only one test case?


Use -Dtest=<test class name> or -Dtest=<test class name>#<test method name> as specified at http://maven.apache.org/surefire/maven-surefire-plugin/examples/single-test.html

ps: use StackOverflow for programming questions - they'll get answered sooner

  • It is not working in jenkins, In project level all test cases are running, in module level no test cases are running Jan 29 '14 at 2:43
  • Just created a test jenkins job for a multimodule project. Added -DfailNoTests=false -Dtest=<test class name> to its 'Goals and options' in a 'Build' section (i.e. my 'Goals and options' param looks like -DfailNoTests=false -Dtest=<test class name> install). As a result the whole project was built, only the specified test class was executed. Jan 29 '14 at 7:08

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.