0

I want to run only Single Test case from Jenkins Job by Parameterized build

So when I pass the classpath of Single Test case in Jenkins Job , Only that Test case should be run. Refer Screenshot This should run 'flow1' Test case

Things I Tried:

  1. Created 'jenkinsTestng.xml' TestNG File with below code
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE suite SYSTEM "http://testng.org/testng-1.0.dtd">
<suite name="My SUITE">
    <test  name="Running new class">
        <classes>
                <class name="${CLASS_NAME}"/>
        </classes>
    </test>
</suite>
  1. In Jenkins, installed Plugin 'Build with Paramters'

  2. In Jenkins Job, Created 2 Parameters--> 'testSuite' & 'CLASS_NAME'. Refer Screenshot

  3. In Build steps

  • Goal = clean test -DsuiteXmlFile=$testSuite
  • Select 'Inject build variables' to true
  1. Tried running the job & getting below error

Cannot find class in classpath: CLASS_NAME org.apache.maven.surefire.booter.SurefireBooterForkException: There was an error in the forked process

Cannot find class in classpath: CLASS_NAME at org.apache.maven.plugin.surefire.booterclient.ForkStarter.fork(ForkStarter.java:656) at org.apache.maven.plugin.surefire.booterclient.ForkStarter.run(ForkStarter.java:282)

0 Answers0