cancel
Showing results for 
Search instead for 
Did you mean: 

Testcomplete Tests hangs when running for days through batch file on remote machines

SOLVED
Highlighted
Super Contributor

Testcomplete Tests hangs when running for days through batch file on remote machines

We are running Testcomplete Tests on remote machines which have TestExecute .We use Batch file. With the help of Task scheduler we are running the tests for every 30 minutes of the day. SO the tests are running every day i.e. 24/7.

when the test finish running we are exporting the MHT report log as well. 

 

Sometimes Test hangs - due to which no other following tests do not run. After looking at the remote machine I saw that the command window -opened by batch file is there and TestExecute started displaying the Testcomplete Indicator showing the Project Item. It hanged in there.  SInce the tests are running for every 30 minutes it do not hangs every 30 minutes.

 

Attached the screenshot showing when TE tests hangs 

 

Thanks

NG

 

 

 

 

 

1 ACCEPTED SOLUTION

Accepted Solutions
Highlighted
Community Leader

Re: Testcomplete Tests hangs when running for days through batch file on remote machines

On your batch file you must wait a little before killing process and launching new instance of TE. Process lifecyle treatment is not instant. So use some pause 3  to pause 3 seconds between each call.

It could be the problem..

 

About windows event log, on your panel on left side you have Windows logs entry with sub category, open the Application category and look at time where the problem occured if any special message appears.

Same for Security category and System category.

 

 

 

Un sourire et ça repart

View solution in original post

18 REPLIES 18
Highlighted
Community Leader

Re: Testcomplete Tests hangs when running for days through batch file on remote machines

First, have you looked into event log of windows (system, application and security logs) to see if any explanation can be found ?

Does TE send back an errorlevel code ?

Does your scripts are local or on a network place ?

What does your test do ?

Does it works only locally or not ?

Does it changes machine state in any kind possible ?

 

We need more details to lookin this.

 

 

Un sourire et ça repart

Highlighted
Super Contributor

Re: Testcomplete Tests hangs when running for days through batch file on remote machines

@BenoitB 

in such condition there is no Testcomplete log posted when TE test hangs .

No we cannot see the errorlevel code , how can I see ?

scripts are local.

M y tests just open the FF browser , do the authentication and navigate to the home page of the application.verify the tile of the page and do some other verifcation when we navigate to other pages. It is a very light automation.

Machine state - I do not understand ?

 

Thanks

NG

 

Highlighted
Community Leader

Re: Testcomplete Tests hangs when running for days through batch file on remote machines

I'm speaking about Windows event log  not TE logs.

Look at them to check for internal/external issue

 

The errorlevel is a standard OS variable updated after execution of a process, it's the exit code of the process

"C:\Program Files (x86)\SmartBear\TestExecute 14\Bin\TestExecute.exe" "C:\Users\Public\Documents\TestComplete\amdm\amdm.pjs" /run /exit /SilentMode /ErrorLog:C:\Users\Public\Documents\Resultats_Automatisation\TestExecuteErrors.mht /DoNotShowLog
if ERRORLEVEL 1001 goto Result1
if ERRORLEVEL 1000 goto Result2
if ERRORLEVEL 127 goto Result3
if ERRORLEVEL 4 goto Result4
if ERRORLEVEL 3 goto Result5
if ERRORLEVEL 2 goto Result6
if ERRORLEVEL 1 goto Result7
if ERRORLEVEL 0 goto Result8
if ERRORLEVEL -1 goto Result9

More info here:

https://support.smartbear.com/testexecute/docs/running/automating/command-line/exit-codes.html

 

Does your test manage FF dialogs like update needed, crash of FF, .. ?

Does your test manage good checking of still-running FF process prior to start test ?

 

Un sourire et ça repart

Highlighted
Community Hero

Re: Testcomplete Tests hangs when running for days through batch file on remote machines

So, TestExecute is running but then there's an error indicating that no file can be found.  So, what's in your batch file that's attempting file copying/transfer, etc?  because that seems to be the problem, not something in TE.

In your TE batch file, are you running TE with the /exit command line?  Or are you somehow closing TE manually in the batch file?  A bit more information of what the batch file actually is would be helpful.


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
Highlighted
Super Contributor

Re: Testcomplete Tests hangs when running for days through batch file on remote machines

@tristaanogre 

 

We are exporting the MHT log file after running every project.  One one remote machine we have 4 projects. each project has only one script . We are exporting the MHT report after every project.  While MHT file get older for e.g. in when it is older than 3 days old we delete the file. In that command we have not put the condition to check for MHT file older than 3 days. When it do not find the file older than 3 days then it throw the error.

 

Let me know if you need more information 

 

Thanks

NG

 

 

Highlighted
Community Hero

Re: Testcomplete Tests hangs when running for days through batch file on remote machines

So, that exporting and processing of the MHT files is part of the Batch file, not part of the Automation code itself?

 

Then this is not a question for TestComplete/TestExecute.  You need to debug your batch file.  The batch file is generating an error and is not closing down properly which is why the next automation can't run.


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
Highlighted
Super Contributor

Re: Testcomplete Tests hangs when running for days through batch file on remote machines

@tristaanogre 

 

 It is part of Automation code itself. In Testcomplete project . I have 2 projectItems one is for the script and the other one is for Export MHT report.

 

 

Highlighted
Community Hero

Re: Testcomplete Tests hangs when running for days through batch file on remote machines

The error presented is not a TestComplete/TestExecute error.  When run as commandline, that type of error is not presented.  So, something is generating that error that is NOT TestComplete/TestExecute.

 

Agin... what's in your batch file?  Share the code from that and maybe we can get you some better help.


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
Highlighted
Super Contributor

Re: Testcomplete Tests hangs when running for days through batch file on remote machines

Here is the batch file attached.

REM Clears the screen
CLS
@Echo OFF
REM delete MHT Report file older than 5 days
REM Launches TestExecute,
REM executes the specified project
REM and closes TestExecute when the run is over

ForFiles /p "C:\TE Results\Finance" /s /m *.mht /d -3 /c "cmd /c del @file"

tasklist /FI "IMAGENAME eq TestExecute.exe" 2>NUL | find /I /N "TestExecute.exe">NUL
if "%ERRORLEVEL%"=="0" taskkill /f /t /im testexecute.exe

"C:\Program Files (x86)\SmartBear\TestExecute 14\x64\Bin\TestExecute.exe" "C:\Users\nisgupta\Documents\TestComplete\IS\Finance\HSC\Budget Revision System\Budget Revision System HSC\BRS HSC\BRS HSC.mds" /run /exit /SilentMode
tasklist /FI "IMAGENAME eq TestExecute.exe" 2>NUL | find /I /N "TestExecute.exe">NUL
if "%ERRORLEVEL%"=="0" taskkill /f /t /im testexecute.exe

"C:\Program Files (x86)\SmartBear\TestExecute 14\x64\Bin\TestExecute.exe" "C:\Users\nisgupta\Documents\TestComplete\IS\Finance\TTU\PCARD Processing\PCARD Processing TTU\PCARD TTU\PCARD TTU.mds" /run /exit /SilentMode
tasklist /FI "IMAGENAME eq TestExecute.exe" 2>NUL | find /I /N "TestExecute.exe">NUL
if "%ERRORLEVEL%"=="0" taskkill /f /t /im testexecute.exe

"C:\Program Files (x86)\SmartBear\TestExecute 14\x64\Bin\TestExecute.exe" "C:\Users\nisgupta\Documents\TestComplete\IS\Finance\TTU\New FOP TTU\NEW FOP TTU\Finance NEW FOP TTU\Finance NEW FOP TTU.mds" /run /exit /SilentMode
tasklist /FI "IMAGENAME eq TestExecute.exe" 2>NUL | find /I /N "TestExecute.exe">NUL
if "%ERRORLEVEL%"=="0" taskkill /f /t /im testexecute.exe

"C:\Program Files (x86)\SmartBear\TestExecute 14\x64\Bin\TestExecute.exe" "C:\Users\nisgupta\Documents\TestComplete\IS\Finance\TTU\Interest Allocation\Interest Allocation TTU\Interest Allocation TTU\Interest Allocation TTU.mds" /run /exit /SilentMode
tasklist /FI "IMAGENAME eq TestExecute.exe" 2>NUL | find /I /N "TestExecute.exe">NUL
if "%ERRORLEVEL%"=="0" taskkill /f /t /im testexecute.exe

IF ERRORLEVEL 1001 GOTO NotEnoughDiskSpace
IF ERRORLEVEL 1000 GOTO AnotherInstance
IF ERRORLEVEL 127 GOTO DamagedInstall
IF ERRORLEVEL 4 GOTO Timeout
IF ERRORLEVEL 3 GOTO CannotRun
IF ERRORLEVEL 2 GOTO Errors
IF ERRORLEVEL 1 GOTO Warnings
IF ERRORLEVEL 0 GOTO Success
IF ERRORLEVEL -1 GOTO LicenseFailed

:NotEnoughDiskSpace
ECHO There is not enough free disk space to run TestComplete
GOTO End

:AnotherInstance
ECHO Another instance of TestComplete is already running
GOTO End

:DamagedInstall
ECHO TestComplete installation is damaged or some files are missing
GOTO End

:Timeout
ECHO Timeout elapses
GOTO End

:CannotRun
ECHO The script cannot be run
GOTO End

:Errors
ECHO There are errors
GOTO End

:Warnings
ECHO There are warnings
GOTO End

:Success
ECHO No errors
GOTO End

:LicenseFailed
ECHO License check failed
GOTO End

:End

New Here?
Join us and watch the welcome video:
Announcements
Top Kudoed Authors