Forum Discussion

rzirpolo's avatar
rzirpolo
Occasional Contributor
6 years ago

TestComplete (TestExecute) Version: 12.50.4142.7 x64 - Batch Testing

Apologies in advance for the generic nature of this post....

 

I have joined a company who have a Project Suite setup which consists of 33 Projects, these tests individually seem to be ok and if run on an individual basis function ok. These are run via a scheduled task which uses a batch file to call the project and create a .mht result file.

 

The batch file being....

 

taskkill /f /im taskeng.exe
taskkill /f /t /im TestExecute.exe
taskkill /f /im rundll*

set DD=%DATE:~0,2%
set MM=%DATE:~3,2%
set YY=%DATE:~8,2%
set YYYY=%DATE:~6,4%
set HH=%TIME:~0,2%
set MN=%TIME:~3,2%

set LOGFILE=UK-Morning-Checks-Busapps%YYYY%-%MM%-%DD%-%HH%-%MN%.MHT

"C:\Program Files (x86)\SmartBear\TestExecute 12\Bin\TestExecute.exe" /run "C:\Test_Complete\UK_MorningChecks_Busapps\MorningChecks_Busapps.pjs" /ExportLog:"\\ukfiler01\busappsroot$\System\Logs\TestComplete\MorningChecks\%LOGFILE%" /ns /DoNotShowLog /exit

taskkill /f /im taskeng.exe
taskkill /f /t /im TestExecute.exe
taskkill /f /im rundll*

 

This is run on a remote PC which has it's session disconnected. At times this runs ok but at other times it's all over the place with failures (which are not true failures as subsquent individual tests run fine) - my gut feeling is if one test fails it struggles to recover as it continues to step through other tests.

 

I want to do a whole re-write of this so after some advice on the best way to run a batch of tests on a remote PC which will be consistent.

 

I believe I'd have to keep a scheduled task and batch file but can anyone offer any advice on the command line or things to implement for the individual tests i.e. pre or post steps or further functionality at Project level?

 

I have searched resources online (and will continue to do so) but after some insight\knowledge of what would work best for this version of TestComplete.

 

As I review all of the tests individually I will create posts asking specific questions - the purpose of this post is to amend a batch of 33 tests (projects) so it's more consistent.

1 Reply

  • tristaanogre's avatar
    tristaanogre
    Esteemed Contributor

    The solution to your problem lies in the architecture of the project (the MDS file) and other internal codings within the project.  The specifics, in a general list are:

     

    1) Go to Tools | Current Project Properties | Playback and verify the settings for Stop on Error and Stop on Exception.  Having these two flags checked, as soon as an error or Exception is logged, will halt the run of that MDS project file.  This may or may not be desirable but it is something to consider

    2) In the Test Items in the project, there are additional "Stop on Exception" and "Stop on Error" flags that can be set per test item in order to control the flow of the project.

    3) The OnLogError event handler can be used to add additional fine-tuning to this workflow control by executing code to recover from errors, stop the current test, etc.

    4) Utilizing Try/Catch/Finally code within the test code itself will help to better recover from errors and make sure that tests don't continue to attempt to run after critical errors occur.

     

    All this is done within the specific projects and/or tests and is not controlled by the commandline.