Forum Discussion

ray_mosley's avatar
ray_mosley
Frequent Contributor
13 years ago

Failure to recopngnize object previously recognized

The attached code snippet is used to execute modules of our application (start application processes).  The function qaStartModule is used repeatedly to start many modules.  In testing a particular section of the application, my test has successfully started the same module multiple times (refer to the attached .jpg file), then suddenly fails attempting to start the same module.  Without doing anything to the application, I simply tell TestComplete to execute the project again.  TestComplete starts the module without issue, then fails agin lated attempting to start the same module.



It has taken me up to 5 times of restarting TestComplete execution to finsh the testing of one module ("Schedule").  The same issue occurs when I go to the next module to be tested ("Bill", "Chart", "DocMan", and "Tracking Board").



What can the issue be?



--------------------  Code Snippet ----------------------------

//Global variables

var taskBarProcesses = new Array(

  "topsbill","CHRTLauncher","codelinker","emdsdocman","doqit",

  "emdsfaxmonitor","fastformeditor","fastformprocessor","FlowEditor","PLABLauncher",

  "piplauncher","refillrequest","RuleManager","topsSchedule","emdstaskMan",

  "templateeditor","enterpriseroommanager","MultiSignOff"  

);

/*

Function qaStartModule

   Function to start an EMDS module from the Run task bar

--preconditions

   EMDS application is running;

---Parameters

   mn = string: module name  

--postconditions

   module has started

--returns

   NA 

*/

/*

//Test driver for qaStartModule function below

function qaStartModuleTestDriver()

{

    for (var i = 0; i < taskBarProcesses.length; i++)

    {

         var processObj = qaStartModule(taskBarProcesses);

         ////Log.Message("Process name = " + processObj.Name);

    }

    Log.Message("function qaStartModule test complete");       

}

//END Test driver for qaStartModule function below

*/

function qaStartModule(mn)

{

     //need to build empty object for return

     var returnObj;

    var emds = Sys.Process("EMDS");

     if (aqString.GetLength(mn) > 0)

     {

         //find module number

         var j;

          for (j = 0; j < taskBarProcesses.length; j++)

          {

               if (!aqString.Compare(taskBarProcesses,mn,false))

               {

                   emds.fmemdsTaskBar.sbRun.Click();

                   emds.fmemdsTaskBar.pnMain.pnSystem.PopupMenu.Click(j);

                   returnObj = emds.WaitChild(taskBarProcesses,15000);   //added for TestComplete 9.0

/*

                   if (!returnObj.Exists)

                   {

                      var dbgHalt = 0;  //DEBUG breakpoint

                   }

*/

                   if (aqString.Compare(mn,"CHRTLauncher",false) == 0)

                   {

                     qaDBNagScreen(mn);

                   }

               }        

          }

      }

     return;  

}

//END OF FUNCTION qaStartModule