Forum Discussion

nisgupta's avatar
nisgupta
Valued Contributor
5 years ago
Solved

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

 

 

 

 

 

  • BenoitB's avatar
    BenoitB
    5 years ago

    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.

     

     

     

18 Replies

  • BenoitB's avatar
    BenoitB
    Community Hero

    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.

     

     

    • nisgupta's avatar
      nisgupta
      Valued Contributor

      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

       

      • BenoitB's avatar
        BenoitB
        Community Hero

        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 ?

         

  • tristaanogre's avatar
    tristaanogre
    Esteemed Contributor

    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.

    • nisgupta's avatar
      nisgupta
      Valued Contributor

      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

       

       

      • tristaanogre's avatar
        tristaanogre
        Esteemed Contributor

        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.