Step 1:- In Jenkins, you have an option to create 'New Job' Item, Click on it.
Step 2:- Enter Job name and select "Free-Style Software Project" and then click on 'OK' button.
Step 3:- You should see header as 'Advanced Project Options' and with a button 'Advanced'. Now Click on "Advanced" option which will display multiple options.
Step 4:- Select 'Use custom workspace' and specify your project location (workspace directory) in Directory
Step 5:- Scroll down to see 'Build' option with 'Add Build Step'. In this drop down select value 'Execute Windows batch command' which Runs a Windows batch script for building the project. The text that we enter in the text box will be executed as a batch file. The script will run with the workspace as the current directory which we have specified in step 4.Job name and select "Free-Style Software Project" and then click on 'OK' button.
Step 6:- Click on Save button. New Job will be created with the configure options that we have defined.. That's It. We have Done.
Now we can execute job file by clicking on the 'Build Now' button which will invoke testng.xml from the batch file. Here the output looks after executing the job: