How to run test suite multiple times using command line

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”

Hi Barry,

I think the easiest way to acheive that is Templates with FOR loops

Something like this:

*** 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, but the template with a for loop is probably easier

Dave.

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

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