Schedule the TestNG Scripts For Execution

As we may be busy with our script development or our manager asks us to prepare an automated scheduler which will run our scripts when we are not available or without our intervention.

Let’s see with an example how we are going to achieve this.

Steps to Create an Automation Scheduler in Windows :

Open the Task Scheduler from Start icon by entering the text scheduler in the search box.

2.Select the Task Scheduler.


  1. A three pane console should be opened.


  1. Goto the third pane i.e Actions and select Create Basic Task.


  1. Create a Basic Task will be opened.


  1. Enter the name of the task and description for the task.


  1. Click “Next” button, which will display the trigger dialog icon.


  1. In the Trigger Diaglog icon, we have an option at what intervals the script needs to run like Daily, Weekly, Monthly, One Time, when the computer starts, When I log on, When a specific event is logged.
  2. Selected Daily in this example.Java-Task-Scheduler-Second-Next
  3. Click Next button.


  1. Select the start and end date.


  1. Click Next button


  1. Action wizard will open.


14.Let the choose be “Start a program”

  1. Click Next button.


16.Click Browse icons.


Select the bat file created for TestNG to be executed.
Click Next button
Finish Dialog icon should be displayed.
Click Finish Button.
In the Task scheduler Summary , you will be able to see the task created in the active Tasks list.
Congratulations you have created your automation scheduler now. The Scheduler will pick the bat file and read the testng.xml to execute the scripts.

Leave a Comment

Your email address will not be published. Required fields are marked *