-1

In my development project, We implemented regression test cases using selenium webdriver using c#. I would like to schedule of Regression tests once in a day. Tools used shows below.

  1. Selenium Webdriver on C#
  2. Visual Studio 2017
  3. NUnit test framework

Please suggest any other solution.

Thanks in advance.

  • You can schedule a job in windows task scheduler to run a the test case using NUnit.exe. – Vivek Natarajan May 28 '19 at 11:57
  • Build the project and use the dll generated with Nunit-Console.exe to run the same. Command Line documentation: http://nunit.org/docs/2.5.9/consoleCommandLine.html NUnit console installer location: https://github.com/nunit/nunit-console/releases – Vivek Natarajan May 28 '19 at 12:10
  • Any thoughts on using Jenkins? You do not go into detail if this is a local project you are working on or if it is company driven? If you create a Jenkins instance, you can start working towards CI/CD. – Dazed May 28 '19 at 13:59
  • @VivekNatarajan Then How will we schedule the test case run – Sangeetha Periyaiah Jun 17 '19 at 10:47

2 Answers2

0

Use task scheduler;

  1. Create a batch file with the command to execute the tests (e.g ..\nunit.exe ..\seleniumTests.cs)
  2. Open 'Task Scheduler'
  3. Create a task with the time/frequency as the 'Trigger' and the set the batch file as the 'Action' to execute.
aolisa
  • 41
  • 3
  • Have we any other options rather than 'Task Scheduler'? – Sangeetha Periyaiah May 29 '19 at 05:00
  • The other options will be to look at a CI tool like Jenkins, alternative use a script as mentioned https://stackoverflow.com/questions/47861172/how-to-schedule-running-a-bat-file-not-using-windows-task-scheduler or https://superuser.com/questions/1273449/automatically-running-a-program-without-task-scheduler – aolisa May 30 '19 at 09:29
0
I found an exact solution for my scenario.

Tools is used:

1. NUnit3 Console. Location: https://github.com/nunit/nunit-console/releases

2. Windows Task Scheduler

 Download NUnit.Console-*.msi file.

 Install exe file. 

Create an nunit command to run your tests:

> nunit3-console testsfile.dll

More details here: https://github.com/nunit/docs/wiki/Console-Command-Line

Next, create the scheduled task

List item

 1. Open Task Scheduler
 2. Under Actions, Click Create a Basic Task
 3. Provide a descriptive name
 4. Choose the starting date and time.
 5. Choose Start a Program as the type of action
 6. In Program/Script add nunit3-console
 7. In Arguments add testsfile.dll
 7. In Start in add nunit3 console location
 8. Click Finish.

Now it will run on the schedule you provided.