Forum Discussion

AlexBorelli's avatar
AlexBorelli
Contributor
9 years ago

Problem seach object

   I have two object. This objects have name equal, but In the NameMapping these objects have differents names. The names of object are dinamics.
   Example: When I open the windows name is: "PadraoJanelaDinamica", if open the windows again the name changes for "PadraoJanelaDinamica1". This happens in both windows. The ClassName of objects are differents: "TJanelaGerarCodigoBarras" and "TPadraoJanelaDinamica". What happen is I open "PadraoJanelaDinamica" the TestComplete not know what I'm opening.

How do I solve this?NameMapping

 


Thank You

  • Thank you Marcha.

     

     

    The problem was solved with FindChield.

     

    procedure producao_por_item_acabado;
    var vezes;
    begin
      for vezes := 1 to 4 do
        if not (Aliases.control.FindChild('ClassName', 'TPadraoJanelaDinamica').Exists) then
          begin
            Aliases.control.Principal.Keys('~m');
            Aliases.control.Principal.PopupMenu.Click('[7]');
            Aliases.control.Principal.PopupMenu.Click('[3]');
            Log.Message('Essa é a ' + IntToStr(vezes) + 'ª tentativa de acesso ao menu.')  
          end
        else
    end;
    • AlexBorelli's avatar
      AlexBorelli
      Contributor

      Thank you Marcha.

       

       

      The problem was solved with FindChield.

       

      procedure producao_por_item_acabado;
      var vezes;
      begin
        for vezes := 1 to 4 do
          if not (Aliases.control.FindChild('ClassName', 'TPadraoJanelaDinamica').Exists) then
            begin
              Aliases.control.Principal.Keys('~m');
              Aliases.control.Principal.PopupMenu.Click('[7]');
              Aliases.control.Principal.PopupMenu.Click('[3]');
              Log.Message('Essa é a ' + IntToStr(vezes) + 'ª tentativa de acesso ao menu.')  
            end
          else
      end;