Ask a Question

Working command line does not work in batch file

SOLVED
tc_2018
Contributor

Working command line does not work in batch file

Hello Everyone,

 

My command line below works perfectly when running on CMD. However, when I put it a batch file, it does not execute my test. It only opens my test suite.

 

c:\Program Files (x86)\SmartBear\TestComplete 14\x64\Bin>TestComplete.exe " C:\Works\MyProjects\SmokeTest.pjs" /r /p:SmokeTestOne /t:"KeywordTests|MyTests"

 

PS: I did follow this post but not successfull.

 

Thanks for your input!

1 ACCEPTED SOLUTION

Accepted Solutions
tristaanogre
Community Hero

Re: Working command line does not work in batch file

You can't run the batch file from TestComplete like that... you need to call TestComplete within the batchfile as the part of the command line as indicated.  Then simply execute the batch file.


Robert Martin
[Hall of Fame]
Please consider giving a Kudo if I write good stuff
----

Why automate?  I do automated testing because there's only so much a human being can do and remain healthy.  Sleep is a requirement.  So, while people sleep, automation that I create does what I've described above in order to make sure that nothing gets past the final defense of the testing group.
I love good food, good books, good friends, and good fun.

Mysterious Gremlin Master
Vegas Thrill Rider
Extensions available

View solution in original post

5 REPLIES 5
AlexKaras
Community Hero

Re: Working command line does not work in batch file

Hi,

 

Can you provide us with the line from command file that does not work?

 

Regards,
  /Alex [Community Hero]
____
[Community Heroes] are not employed by SmartBear Software but
are just volunteers who have some experience with the tools by SmartBear Software
and a desire to help others. Posts made by [Community Heroes]
may differ from the official policies of SmartBear Software and should be treated
as the own private opinion of their authors and under no circumstances as an
official answer from SmartBear Software.
The [Community Hero] signature is used with permission by SmartBear Software.
https://community.smartbear.com/t5/custom/page/page-id/hall-of-fame
================================
tc_2018
Contributor

Re: Working command line does not work in batch file


@AlexKaras wrote:

Hi,

 

Can you provide us with the line from command file that does not work?

 


REM Clears the screen
CLS
@ECHO OFF
REM Launches TestComplete,
REM executes the specified project
REM and closes TestComplete when the run is over
"C:\Works\DriverLicense\DLS_SmokeTest.pjs" /r /p:DLS_SmokeTest /t:"KeywordTests|MyTests" /run /exit

IF ERRORLEVEL 1001 GOTO NotEnoughDiskSpace
IF ERRORLEVEL 1000 GOTO AnotherInstance

...

...

:End



tristaanogre
Community Hero

Re: Working command line does not work in batch file

You need to actually reference the TestComplete tool.  

 

REM Clears the screen
CLS
@ECHO OFF
REM Launches TestComplete,
REM executes the specified project
REM and closes TestComplete when the run is over
"C:\Program FIles (x86)\SmartBear\TestComplete 14\bin\TestComplete.exe" "C:\Works\DriverLicense\DLS_SmokeTest.pjs" /r /p:DLS_SmokeTest /t:"KeywordTests|MyTests" /run /exit

IF ERRORLEVEL 1001 GOTO NotEnoughDiskSpace
IF ERRORLEVEL 1000 GOTO AnotherInstance

...

...

:End

Robert Martin
[Hall of Fame]
Please consider giving a Kudo if I write good stuff
----

Why automate?  I do automated testing because there's only so much a human being can do and remain healthy.  Sleep is a requirement.  So, while people sleep, automation that I create does what I've described above in order to make sure that nothing gets past the final defense of the testing group.
I love good food, good books, good friends, and good fun.

Mysterious Gremlin Master
Vegas Thrill Rider
Extensions available
tc_2018
Contributor

Re: Working command line does not work in batch file


@tristaanogre wrote:

You need to actually reference the TestComplete tool.  

 

REM Clears the screen
CLS
@ECHO OFF
REM Launches TestComplete,
REM executes the specified project
REM and closes TestComplete when the run is over
"C:\Program FIles (x86)\SmartBear\TestComplete 14\bin\TestComplete.exe" "C:\Works\DriverLicense\DLS_SmokeTest.pjs" /r /p:DLS_SmokeTest /t:"KeywordTests|MyTests" /run /exit

IF ERRORLEVEL 1001 GOTO NotEnoughDiskSpace
IF ERRORLEVEL 1000 GOTO AnotherInstance

...

...

:End

From CMD, I cd to C:\Program FIles (x86)\SmartBear\TestComplete 14\bin\. And

C:\Program FIles (x86)\SmartBear\TestComplete 14\bin> TestComplete.exe myTestFile.bat

tristaanogre
Community Hero

Re: Working command line does not work in batch file

You can't run the batch file from TestComplete like that... you need to call TestComplete within the batchfile as the part of the command line as indicated.  Then simply execute the batch file.


Robert Martin
[Hall of Fame]
Please consider giving a Kudo if I write good stuff
----

Why automate?  I do automated testing because there's only so much a human being can do and remain healthy.  Sleep is a requirement.  So, while people sleep, automation that I create does what I've described above in order to make sure that nothing gets past the final defense of the testing group.
I love good food, good books, good friends, and good fun.

Mysterious Gremlin Master
Vegas Thrill Rider
Extensions available

View solution in original post

cancel
Showing results for 
Search instead for 
Did you mean: