Forum Discussion

MAK89's avatar
MAK89
Occasional Contributor
9 years ago

Test Complete is not giving row and column count of VCLObject("GridPanel").

Test Complete is not giving row and column count of Grid object of Delphi Application. Whenwver I try to do the same it gives the following error:

Error: 
An error occurred.
Possible reasons:
1. The application stopped responding.
2. The application was compiled incorrectly (see the Open Applications topic in the help system).
3. An error occurred in TestComplete.

Technical information:
97 0x80020006 (Unknown name.) Levels

 

PS: Also see attachment.

5 Replies

  • AlexKaras's avatar
    AlexKaras
    Champion Level 3

    Hi,

     

    -- Version of TestComplete?

    -- Version of Delphi?

    -- Tested application bitness?

    -- Component name and Window Class of the grid?

    -- Was the tested application prepared as required (https://support.smartbear.com/viewarticle/74507/) and was correct file with debug information used? (I.e. wasn't occasionally used the debug information from some previous build?)

  • MAK89's avatar
    MAK89
    Occasional Contributor

    Colin_McCrae

    Yes wndclass is 'TcxGrid' and Yes i have DEvExpress control support. [please refer to image]

    • Colin_McCrae's avatar
      Colin_McCrae
      Community Hero

      Hmmm.

       

      I don't have any that match your type of grid unfortunately.

       

      I have a .NET type "GridControl" which the wColumnCount and wRowCount work fine.

       

      And I have a Delphi grid of type TwwDBGrid. But that uses completely different properties to get the column and row counts. The column count is simple, but the row count has to be obtained from the underlying DataSet object which populates the grid.

       

      Is your Delphi app compiled with debug info on? I can't use the TwwDBGrid without it as I need access to native methods and properties that are only exposed if compiled with debug info. (If your executable uses BPL files - like DLL's - these need to be embedded into the exe at compile time. Without them, TC can't access a lot of the native stuff)

  • I might use this logic to calculate which I have used for one of the grids which dont have any row or column count properties in Test complete. My grid was in a desktop application but I am sure you can use it on web application grid  as well. I know its a roundabout process but it works if you have no choice in Test complete.

    function ReturnOleGridRowAndColumnCount(var RowsCount:integer;var ColumnCount:integer;grid:OleVariant);
    var
    count,colCount,rowCount,i:integer;
    endOfData:boolean;
    colVlu:string;
    begin    
      count := 0;
      colCount := 0;
      endOfData := true;
      while (endOfData) do
      begin
        try            
          colVlu := Evaluate('grid.TextMatrix[0,' + VarToStr(count) + ']');            
          count := count + 1;
          colCount := colCount + 1;           
        except                        
          endOfData := false;          
          ColumnCount := colCount ;      
        end;
      end;
        
      rowCount := 0;
      count := 0;
      endOfData := true;
      while (endOfData) do
      begin
        try                 
          colVlu := Evaluate('grid.TextMatrix['+VarToStr(count)+','  + '0]');     
          count := count + 1;
          rowCount :=  rowCount + 1;            
        except                                              
          endOfData := false;     
          RowsCount := rowCount;                
        end;
      end;
          
    end;

     

     All you need here is some Property like Grid.TextMatrix[Rowno,ColNo]