Here is my sample batch file, my problem is when I assign testCaseName=%%A, it only shows assigned to the last line of the file (REST0007-SHIPMETDATA_POST-XPERF_ErrorPath-ShipmentNULLServiceSchedID_TestCase). But when I use echo %%A, it shows all lines as it reads in loop.
Why set testCaseName=%%A in the batch file only reading the last line ?
.batch file:
Code: Select all
echo off
cd d:\SWAT
set fileNameXPERF=d:\SWAT\ShipmentPostErrorPathXPERF.txt
for /F "tokens=*" %%A in (D:\SWAT\ShipmentPostErrorPathXPERFxxx.txt) do (
set testCaseName=%%A
echo %testCaseName%
echo %%A
call d:\SWAT\testRunner.cmd %testCaseName%
)
Code: Select all
REST0007-SHIPMETDATA_POST-XPERF_ErrorPath-ShipmentEmptyDockNum_TestCase
REST0007-SHIPMETDATA_POST-XPERF_ErrorPath-ShipmentNULLDockNum_TestCase
REST0007-SHIPMETDATA_POST-XPERF_ErrorPath-ShipmentInvalidDockNum_TestCase
REST0007-SHIPMETDATA_POST-XPERF_ErrorPath-ShipmentEmptyServiceSchedID_TestCase
REST0007-SHIPMETDATA_POST-XPERF_ErrorPath-ShipmentNULLServiceSchedID_TestCase