1

I have 120 test cases and I execute all these test cases through a pom.xml (maven) file in jenkins.

Now if I want to execute just one of these 120 test cases, how can I do that?
Is there any way to give the inputs to jenkins while in run-time?

If anyone has an idea on how to do that please share.

1

I am new here, I cannot comment. I am assuming you are using maven surefire plugin, If so you can pass in any particular test name in maven goal

mvn -Dtest={your-test} test

If not, you can edit question with some details/may be part of pom.xml and maven goal from jenkins.

| improve this answer | |
  • Good answer. Actually OP can modify goal of existing Jenkins job or create a copy of existin job with modified goal. There was also an option to define job with parameters, so when you click "Build with parameters" you can either choose a default goal or enter the goal with reuired test name. – dzieciou Mar 13 '16 at 11:06
  • Thanks for valuable answer @DevOps_101 , I have followed your steps but I am getting the following error [JENKINS] Recording test results hudson.AbortException: Test reports were found but none of them are new. Did tests run? For example, C:\Users\hb\workspace\MFA\MFA\target\surefire-reports\TEST-TestSuite.xml is 56 min old – QAMember Mar 14 '16 at 9:50
  • can you try to keep 5 tests in a independent project and run them once they all run, try this parameter to see if you can run 1 test to make sure we are trying to solve the problem in the right place also what jerkins version you are using on windows ? – DevOps_101 Mar 14 '16 at 22:26
  • Thanks once again for your help . Now I can able to run the scripts but I am using the parameter annotation for before method so it is throwing an error org.testng.TestNGException: Parameter 'folderName' is required by Configuration annotation on method setUp_HerveLeger but has not been marked @Optional or defined – QAMember Mar 15 '16 at 14:12
  • I am using jenkins version 1.596 v – QAMember Mar 15 '16 at 14:12

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.