Show test result in Jenkins (tested with only one testsuite)

add batch command in Jenkins project configuration window under build

cd C:\KatalonStudio\Katalon_Studio_Windows_64-5.8.6

katalon -noSplash -runMode=console -projectPath=“C:\KatalonStudio\DataDrivenTestMaster\Data Driven.prj” -retry=0 -testSuitePath=“Test Suites/Pdf” -executionProfile=“default” -browserType=“Chrome” -reportFolder=“Reports/Pdf” -reportFileName=“report”

#delete existing files from the Jenkins Reports folder

del /q “C:\Program Files (x86)\Jenkins\workspace\Katalon Studio pdf test\Reports\*”

FOR /D %%p IN (“C:\Program Files (x86)\Jenkins\workspace\Katalon Studio pdf test\Reports\.”) DO rmdir “%%p” /s /q

#fetch latest folder Report from the Katalon project

FOR /F “delims=” %%i IN (‘dir “C:\KatalonStudio\DataDrivenTestMaster\Reports\Pdf” /b /ad-h /t:c /o-d’) DO (

SET a=%%i

GOTO :found

)

echo No subfolder found

goto :eof

:found

echo Most recent subfolder: %a%

#copy files from the Katalon test Reports folder to the Jenkins Report folder

robocopy C:\KatalonStudio\DataDrivenTestMaster\Reports\Pdf\%a% “C:\Program Files (x86)\Jenkins\workspace\Katalon Studio pdf test\Reports” /E /COPYALL /V /NP /R:0

#ignore permission issue

if ERRORLEVEL 1 set ERRORLEVEL=0