Forum Discussion

superuser's avatar
superuser
Occasional Contributor
13 years ago

Getting Unable to detech the test complete Error

Hi,

I am writing in excel by C++ scripting the data is big and i am writing in phases.

Each time we are closing the driver and again invoking but after 20 min or writing 100 records i  m getting the "Unable to detech the test complete Error"

Immediate Help would be much appreciated.

4 Replies

  • tristaanogre's avatar
    tristaanogre
    Esteemed Contributor
    Also, could you post the code as to what you mean by "closing the driver"?  It's possible that the connection to the file might not be totally closed.  There is a limitation in the Microsoft drivers for reading Excel and CSV files that you can only open a maximum of 64 connections.  You might be hitting that limit if the driver is not getting closed.
  • superuser's avatar
    superuser
    Occasional Contributor
     Hi Robert,

    Thanks for your reply.

    we have tried to close the driver as well but after some time the excel writing becomes slow by seeing the task manager. We are using Testcomplete 6 ver. The test complete popup stating "Unable to detech the test complete" is coming and stoping the execution.





    here is the code



    function writing_Excel(id_list,Id_array,Filename,start_combination)

      {

             var ecu_dummyarray=new Array()

             var simFile_towrite=new Array()

             for(m=0;m<ecu_array["length"];m++)

             {

               var str="";

               ecu_dummy=ecu_array["split"]("_")

               for(n=1;n<ecu_dummy["length"];n++)

                {

                  str=str+ecu_dummy;

                }

                ecu_dummyarray= str

             }

             ECU_Final_Array=GUI_names(ecu_dummyarray)

             var driver = Sys["OleObject"]("Excel.Application");

              //Create_Status_Report_File()

              var Handle = driver["Workbooks"]["Open"](GUI_STP_PATH);

              driver = driver["ActiveWorkbook"]["Worksheets"]("System")

              if(aqString["Contains"](SimFile,"CAN_",0,true) != -1)

              {

              detail=7

              }

              if(aqString["Contains"](SimFile,"DDL2_",0,true)!=-1 || aqString["Contains"](SimFile,"KWP_",0,true)!=-1)

              {

            detail=8

              }

              if(aqString["Contains"](SimFile,"DDL_",0,true)!=-1)

              {

            detail=9

              }

               simFile_towrite=SimFile["split"](".")

                 //ROW_NUMBER=Get_current_Row_index("VerificationDetails");

       

              try

              {

                  for(d=0;d<ECU_Final_Array["length"];d++)

                  {

                  if(d==0)

                  {

                  ROW_NUMBER=Get_current_Row_index_STP("System");

                  }

                  driver.Cells(ROW_NUMBER, 1) = VarToString(start_combination); 

                  driver.Cells(ROW_NUMBER, 2) = ecuid_list;

                  driver.Cells(ROW_NUMBER, 3) = ECU_Final_Array;

                  driver.Cells(ROW_NUMBER, Sim_detail) = simFile_towrite[0];

                  ROW_NUMBER++;

                  //driver.Cells(ROW_NUMBER, TV4) = VarToString(topoversion4);

                  }

                  Handle["Save"];

                  Handle["Close"]; 

                    

                }

              catch(exception)

              {

                Log["Error"]("Exception", exception["description"]);

              }

        

                            

      }



    Is there any way to close and driver in C++ scripting.