Ravik
11 years agoSuper Contributor
Solved
Not able to run test script through batch file
I want to create a batch file wherein I would be able to run the whole test clicking on that batch file. I tried the following code but then it's getting stuck on the the step to recognize the script :
REM Clear the screen
Cls
@ECHO OFF
REM lounches TestComplete
REM Execute the Specified Project
REM and Close the Test Execution when Run is Over
"C:\Program Files\Automated QA\TestComplete 8\Bin\TestComplete.exe" "D:\Subhasis\Reliance_only\SNA\SNA.pjs"/r/P:SNA1/pi:ProjectTestItem1
IF ERRORLEVEL 3 GOTO CannotRun
IF ERRORLEVEL 2 GOTO Errors
IF ERRORLEVEL 1 GOTO Warnings
IF ERRORLEVEL 0 GOTO Success
:CannotRun
ECHO The Script can not run
GOTO END
:Errors
ECHO There are Errors
GOTO END
:Warnings
ECHO There are warnins
GOTO END
:Success
ECHO Your Test Success
GOTO END
We tried various combination to run the scripts by changing the bold part in the script through the solutions provided in your forum but nothing is working as such.
- Hi Ravi,
I can see at least 2 probkems with your command line:
1. You miss spaces between command line parameters (/r /P:SNA1 /pi:ProjectTestItem1) - pay attention to the spaces here
2. You mix project items with test items, but they are completely different items. You can't run a specific Test Item from command line, you need to specify either project name (simply remove the /pi parameter) or a certain routine (i.e. function or procedure name).