Forum Discussion

AlexBorelli's avatar
AlexBorelli
Contributor
8 years ago
Solved

Error performing new attempt to see if a window is open

Good morning I'm trying to check if a window is open. If you are not open I try again. But if the window is not open the TestComplete displays error in the log.   How do I solve this?   Follow...
  • AlexBorelli's avatar
    AlexBorelli
    8 years ago

    Hi

     

    It's OK. My code after your help.

     

    procedure clientes;
    var vezes;
    begin
       vezes := 1;
       for vezes := 1 to 3 do
        begin
          if not(Aliases.control.WaitAliasChild('Clientes', 500).Exists) then
            begin
              Aliases.control.Principal.Keys('~c');
              Aliases.control.Principal.ToolBar1.PopupMenu.Click('[0]');
              Aliases.control.Principal.ToolBar1.PopupMenu.Click('[0]');
              Log.Message('Essa é a ' + IntToStr(vezes) + 'ª tentativa de acesso ao menu.')               
            end        
          else
            if not Aliases.control.Clientes.Visible then
              begin
                Aliases.control.Principal.Keys('~c');
                Aliases.control.Principal.ToolBar1.PopupMenu.Click('[0]');
                Aliases.control.Principal.ToolBar1.PopupMenu.Click('[0]');
                Log.Message('Essa é a ' + IntToStr(vezes) + 'ª tentativa de acesso ao menu. Janela ja existia na memoria.')               
              end
          end
    end;

    Thank you.