How to start the controller from the command line automatically?


Below is the command line argument to invoke the controller

Wlrun.exe –TestPath C:\Temp\Scenario1.lrs –ResultLocation C:\Temp –ResultCleanName Res1 –Run

wlrun.exe is the controller executable file
-TestPath mentions the location from where the Test Scenario is to be invoked
-ResultLocation mentions the location where the Raw Result has to be saved
-ResultCleanName mentions the name with which Raw Result has to be saved

-ResultLocation & -ResultCleanName arguments can be merged together into a single argument
-ResultName

So the command now becomes

Wlrun.exe –TestPath C:\Temp\Scenario1.lrs -ResultName C:\Temp\Res1 –Run

-ResultName mentions the location & filename with which Raw Result has to be saved

If we would like to invoke the Analysis once the test completes then add the argument
–InvokeAnalysis to the above command

So the command now becomes

Wlrun.exe –TestPath C:\Temp\Scenario1.lrs -ResultName C:\Temp\Res1 –Run –InvokeAnalysis

Note


  • If the scenario does not specify where the results have to be saved and also even if one of the above parameters was not passed, the scenario will not run.
  • The results will always be automatically collated upon scenario termination.
  • The results will always be automatically overwritten.

Now comes the automation part.



  1. Copy the above command in a notepad and save the file as batch file. Example: ControllerAutomate.bat
  2. Now open the Windows Task Scheduler and click Create Basic Task.
  3. Mention a Name of the Task in Create A Basic Task. Example -  Controller Scheduler
  4. In the Trigger mention when you want to trigger the batch file. Select One Time and set the Date & Time.
  5. In the Action Select Start a Program, then browse and Select the batch file.
  6. Finish shows the summary of all the selections we have made in the above steps. Verify & click Finish.

Thats it, Windows Task Scheduler will trigger the batch file in the mentioned Date & Time.

Note

  • Make sure that Controller is closed before trying to automatically trigger it.


No comments:

Post a Comment