How to Run TestNG Tests on Jenkins

后端 未结 3 1005
傲寒
傲寒 2020-11-30 13:00

I\'m trying to run TestNG tests (in a contained Java project) from Jenkins but having no luck.

It appears as though the TestNG plugin for Jenkins (https://wiki.jen

3条回答
  •  轻奢々
    轻奢々 (楼主)
    2020-11-30 13:26

    There are two steps to accomplished this task:-

    Step 1:-

    1. Go to localhost:8080/configure (Jenkins configure section)

    2. Now go to JDK section and uncheck Install automatically (If you don't uncheck that then it will download latest java every time whenever it is available, and can cause for build failed)

    3. put JAVA_HOME in name section and jdk home path in JAVA_HOME section

    1. Apply and save

    Step 2:-

    1. Go to Jenkins and add new Item, also select "Free Style Project" and click on Ok.

    2. Click on "Advanced in "Advanced Project Options"

    3. Now check option: - "Use custom workspace" and specify your project absolute path in Directory section

    1. Apply

    2. Now to go "Build" and select "Execute windows batch command"

    3. Here in command column give the file name of your batch file
    4. Apply and save

    Now go to the Jenkins and select your Jenkins project and click on Build :)

提交回复
热议问题