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






  • ray_mosley's avatar
    ray_mosley
    Frequent Contributor
    This line from the code snippet seems to be causing my delay and failure.  

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

    What I expected is that TestComplete would resume execution as soon as it saw the process, which worked well in 8.7.  However in 9.0 it seems that TestComplete waits for the amount of time specified and then starts the process.  By that time however, TestComplete has stopped because Stop on Error is set.



    I changed the line above to be

        aqUtils.Delay(2000);

    and it is running fine.



    Is there an issue with the 9.0 implementation of WaitChild?

     
  • ray_mosley's avatar
    ray_mosley
    Frequent Contributor
    Even the code change from my last post sometimes fails (failure rate is about 20% of the failures when I was using WaitChild), but the application testing is going MUCH smoother (faster and more reliable) using the delay instead of the WaitChild.  I would not have expected this. So more question remains - Is the an issue in how WaitChild functions in 9.0?
  • soda's avatar
    soda
    Contributor
    Hi Harlan,

    I had reported a problem with WaitNamedChild.  It broke from TestComplete 8 to TestComplete 9 for me so was hanging when waiting for a child.  They supplied a patch, but it was I believe specifically for WaitNamedChild.  Have you reported a bug?

  • ray_mosley's avatar
    ray_mosley
    Frequent Contributor
    Mark indicated in his response that he was having issues with WaitNamedChild, for which he has submitted a ticket.  I have just submitted tickets for this issue with WaitChild and a second for FindChild.



    The issue with FindChild not recognizing the on-screen object, the code and values used in the FindChild code and locals debug window, and shows the object recognition failure are shown in the attached screen shots. 

  • Hi,



    We've received the case you mentioned. Let's continue using it for any further communication on this matter.
  • Hello,



    Is there a solution to this problem or not yet?



    We were about to implement the WaitChild instead of the delays, but TestComplete just hangs and cannot stop the execution unless we kill the application process.



    We are using TC9.0.

    Is this issue fixed in 9.1 by any chance?



    Thanks,

    Camelia