# How to run test suite multiple times using command line

**URL:** <https://forum.robotframework.org/t/how-to-run-test-suite-multiple-times-using-command-line/7094>\
**Category:** Robot Framework\
**Created:** [29 March 2024 10:08 UTC](https://forum.robotframework.org/t/how-to-run-test-suite-multiple-times-using-command-line/7094 "2024-03-29T10:08:36Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![bweston](https://dub1.discourse-cdn.com/flex005/user_avatar/forum.robotframework.org/bweston/32/1298_2.png) [@bweston](https://forum.robotframework.org/u/bweston)\
**Post date:** [29 March 2024 10:08 UTC](https://forum.robotframework.org/t/how-to-run-test-suite-multiple-times-using-command-line/7094/1 "2024-03-29T10:08:36Z")

</div>

I have a test suite that I would like to run 25 times consecutively. I am using VS Code. Can this be done using command line in terminal? I know for a test case you can use … to repeat N times. How is this done for test suite?

My example where Admin.robot is my suite:  
robot -N “Full Smoke Test Run” -d c:\Temp\results “Tests/Smoke Tests/Admin.robot”

---

<div class="post-metadata">

**Author:** ![damies13](https://dub1.discourse-cdn.com/flex005/user_avatar/forum.robotframework.org/damies13/32/623_2.png) [@damies13](https://forum.robotframework.org/u/damies13)\
**Post date:** [29 March 2024 13:55 UTC](https://forum.robotframework.org/t/how-to-run-test-suite-multiple-times-using-command-line/7094/2 "2024-03-29T13:55:44Z")

</div>

Hi Barry,

I think the easiest way to acheive that is [Templates with `FOR` loops](https://robotframework.org/robotframework/latest/RobotFrameworkUserGuide.html#toc-entry-288)

Something like this:

```python
***Test Cases***
Template with FOR loop
    [Template] Example keyword
    FOR ${index} IN RANGE 25
        1st arg ${index}
    END

```

You can also do it with a listener, like the example in this thread: [Can I run Setup, Test and Teardown separately? - #14 by damies13](https://forum.robotframework.org/t/can-i-run-setup-test-and-teardown-separately/3878/14), but the template with a for loop is probably easier

Dave.

---

<div class="post-metadata">

**Author:** ![CharlieScene](https://dub1.discourse-cdn.com/flex005/user_avatar/forum.robotframework.org/charliescene/32/3484_2.png) [@CharlieScene](https://forum.robotframework.org/u/CharlieScene)\
**Post date:** [30 March 2024 06:33 UTC](https://forum.robotframework.org/t/how-to-run-test-suite-multiple-times-using-command-line/7094/3 "2024-03-30T06:33:53Z")

</div>

Hello,

You could also use standard powershell commands and build a script that does this :

```
Write-Host "Suite ?"
$suite = Read-Host

Write-Host "Replay xN? "
$iteration = Read-Host

$counter = 0
while ($counter -lt $iteration) {
     robot -N "Full Smoke Test Run" -d "c:\Temp\results" "Tests/Smoke Tests/$suite.robot"
$counter++

```

}

Cool thing is that you could also manage output naming, then merge them in a loop.

Regards.  
Charlie

---

<div class="post-metadata">

**Author:** ![lindemar](https://dub1.discourse-cdn.com/flex005/user_avatar/forum.robotframework.org/lindemar/32/3493_2.png) [@lindemar](https://forum.robotframework.org/u/lindemar)\
**Post date:** [4 April 2024 06:03 UTC](https://forum.robotframework.org/t/how-to-run-test-suite-multiple-times-using-command-line/7094/4 "2024-04-04T06:03:06Z")

</div>

Hi Barry

I do this with a simple batch script which runs the test suite in a loop and copy the results into a specific directory.

```
@echo off

cd c:\Bitbucket\ZoneEaseTesting\python-test-machine      
set comPort=COM04
set results=ResultsR10 01-14-2050 COM04 D3 2023-04-01

for /l %%i in (1, 1, 25) do (
ECHO Loop no.: %%i @ %comPort%
set test=06_Various_Functions
set testName=06_Various_Functions-%%i
if %%i LEQ 9 (        
    set testName=06_Various_Functions-0%%i
    )
set pause=180
call :run_test
)

> goto :EOF

@REM echo.

:run_test
env\Scripts\robot --noncritical noncritical --noncritical quarantined --RemoveKeywords WUKS --dotted --variable CONFIG_FILE:config/ZoneEaseLC.yaml -v SUITE_GRAPH:FALSE -v PARALLEL_EXECUTE:FALSE "test\ZoneEase\LCA\%test%"
timeout /t %pause%
ROBOCOPY "C:\Bitbucket\ZoneEaseTesting\python-test-machine" "C:\Testing\ZoneEase\ZoneEase R10\TestReports\%results%\%testName%" "log.html" "output.xml" "report.html"
timeout /t 10
EXIT /B

```
