Forum Discussion
Bharadwaj
10 years agoContributor
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]