Forum Discussion

temo25's avatar
temo25
Occasional Contributor
5 years ago

recorded script unable to find the object "GroupButtons"

Hello, 

I'm using Testcomplete 14.30.3743.7 version (License: Perpetual (Desktop))

We have desktop app, that I'm testing it with Testcomplete. There were everything OK in Testcomplete 12.60.5545.7 version. But now, when I upgrade my testcomplete version, there are some bugs. 

 

There is part of my code:

function test() {

...

Aliases.B6.DialogOneTimeFeeTypes.rgAppCard.TGroupButton.ClickButton();

...

}

There is a problem with GroupButton-s. Recorded scripts couldn't run , because program doesn't recognize GroupButtons. Problem appeared in  14.30.3743.7 version. When I record new script, there are no changes in it, everything is the same, but new script runs and works correctly, before next GroupButton.

We use "Record script" in javascript, not Keyword Test.

9 Replies

  • tristaanogre's avatar
    tristaanogre
    Esteemed Contributor

    Generally, this means that something has changed in the identification of the object.  For us to help you diagnose better we need to see.

     

    1) The code you're attempting to run

    2) A screenshot of the Mapping criteria for TGroupButton including the hierarchy

    3) The "Additional Info" from your error message on the object not found

    4) A screenshot of the Advanced Properties of button from your Object Browser.

    • temo25's avatar
      temo25
      Occasional Contributor

      function OneTimeFeeTypes()
      {
      Aliases.B6.MainForm.MainMenu.Click("[8]|[10]|[17]|[0]");

      //// View
      Aliases.B6.MainForm.MDIClient.ListOneTimeFeeTypes.ViewBtn.Click(18, 15);
      Aliases.B6.DialogOneTimeFeeTypes.CancelBtn.ClickButton();

      //// Add
      Aliases.B6.MainForm.MDIClient.ListOneTimeFeeTypes.AddBtn.Click(11, 19);
      Aliases.B6.DialogOneTimeFeeTypes.edDescrip.Keys("ტესტკომპლიტ");
      Aliases.B6.DialogOneTimeFeeTypes.edDescripLat.Click(34, 12);
      Aliases.B6.DialogOneTimeFeeTypes.edDescripLat.Keys("testcomplete");
      Aliases.B6.DialogOneTimeFeeTypes.lcbProductCategories.Click(339, 16);
      Aliases.B6.DialogOneTimeFeeTypes.lcbProductCategories.Keys("[Down][Enter]");
      Aliases.B6.DialogOneTimeFeeTypes.rgAppCard.TGroupButton.ClickButton();
      // Aliases.B6.DialogOneTimeFeeTypes.rgAppCard.TGroupButton2.ClickButton();
      Aliases.B6.DialogOneTimeFeeTypes.clbOpType.Click(444, 15);
      Aliases.B6.DialogOneTimeFeeTypes.clbOpType.Keys("[Down][Down][Down][Down][Down][Down][Down][Down][Down][Down][Down][Down][Enter]");
      Aliases.B6.DialogOneTimeFeeTypes.OKBtn.ClickButton();
      //// Change
      Aliases.B6.MainForm.MDIClient.ListOneTimeFeeTypes.EditBtn.Click(13, 21);
      Aliases.B6.DialogOneTimeFeeTypes.edDescrip.Keys(GetRandomGeorgianText(5) + "[Tab]");
      Aliases.B6.DialogOneTimeFeeTypes.edDescripLat.Keys(GetTranslatedTextToEng());
      Aliases.B6.DialogOneTimeFeeTypes.rgAppCard.TGroupButton.ClickButton();
      Aliases.B6.DialogOneTimeFeeTypes.OKBtn.ClickButton();
      //// View
      Aliases.B6.MainForm.MDIClient.ListOneTimeFeeTypes.ViewBtn.Click(18, 15);
      Aliases.B6.DialogOneTimeFeeTypes.CancelBtn.ClickButton();
      Aliases.B6.MainForm.MDIClient.ListOneTimeFeeTypes.Close();
      }

       

      here is my code fragment. 

      when I record new script, there is the same TGroupButton Mapping criteria. 

      there is new code fragment: 

      function Test1()
      {
      var dialogOneTimeFeeTypes = Aliases.B6.DialogOneTimeFeeTypes;
      var TDBRadioGroup = dialogOneTimeFeeTypes.rgAppCard;
      var groupButton = TDBRadioGroup.TGroupButton;
      groupButton.ClickButton();
      var groupButton2 = TDBRadioGroup.TGroupButton2;
      groupButton2.ClickButton();
      groupButton.ClickButton();
      groupButton2.ClickButton();
      var txDBLookupCombo = dialogOneTimeFeeTypes.clbOpType;
      txDBLookupCombo.Click(448, 12);
      txDBLookupCombo.Keys("[Down][Down][Down][Enter]");
      groupButton.ClickButton();
      var txDBMemo = dialogOneTimeFeeTypes.mmSQL;
      txDBMemo.Click(59, 70);
      txDBMemo.Keys("4564");
      }

      • tristaanogre's avatar
        tristaanogre
        Esteemed Contributor

        The additional info gives us the clue.  The problem is not with TGroupButton it's with what is showing as VCLObject("rgAppCard").  I'm guessing that this is a timing issue.  There's an activity that you are doing in your main code before you call that GroupButton click.  I'm guessing that's waht creates the "rgAppCard" object.  So, this is a matter of making sure that there is sufficient code waiting for the objects to appear before they are utilized.  TC 14 has had some object identification improvements over TC 12 which has improved efficiency of the processing.  So, this might be a matter of TC 14 running FASTER than TC 12 and therefore objects are not created in time.

         

        As a test, put an aqUtils.Delay(2000) right before you call to click the button.  if this works, then that means you need to re-write your code a bit for a better timing or increase your Default timeout.