Forum Discussion
5 Replies
- AlexKarasChampion 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?)
- Colin_McCraeCommunity Hero
Class name appears to be a TcxGrid. Which is a Dev Express grid right?
Smartbear help page for them here: https://support.smartbear.com/viewarticle/75826/
You have the DevExpress addon enabled I take it?
- MAK89Occasional Contributor
Yes wndclass is 'TcxGrid' and Yes i have DEvExpress control support. [please refer to image]
- Colin_McCraeCommunity 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)
- BharadwajContributor
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]
Related Content
Recent Discussions
- 2 days agoGane195