UltraGrid using too much memory
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
UltraGrid using too much memory
I am testing a desktop application where I need to access the ultragrid object.
As part of the test I need to loop through the grid to get cell objects:
I have the following lines of code:
while (!TableList.IsEOF())
{
actual_Item = Grid.Rows.Item(i).Cells.Item(ColumnIndex).Value.OleValue;
expected_Item = TableList.Value(TableColName);
}
Through tests, I am finding that the line:
actual_Item = Grid.Rows.Item(i).Cells.Item(ColumnIndex).Value.OleValue;
is using up a lot of memory as such that it causes test complete to crash.
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
while (!TableList.IsEOF())
{
actual_Item = Grid.Rows.Item(i).Cells.Item(ColumnIndex).Value.OleValue;
expected_Item = TableList.Value(TableColName);
}
In the above code, where are you incrementing i ?. which looping on the same which might be the reason for TestComplete to crash.
You have to change your code like below.
var i = 0; while (!TableList.IsEOF()) { actual_Item = Grid.Rows.Item(i).Cells.Item(ColumnIndex).Value.OleValue; expected_Item = TableList.Value(TableColName); i++; }
Thanks
Shankar R
LinkedIn | CG-VAK Software | Bitbucket | shankarr.75@gmail.com
“You must expect great things from you, before you can do them”- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I only included a snippet of code to illustrate my problem.
But you are right, for the while loop to work it needs the i increment and the advancement of the table iterator, i.e
TableList.Next...
