jeremy_berge
15 years agoNew Member
TestComplete : dealing with TListview on steroids
Hi,
For one of our projects (Delphi), we are using a TListView component to display a *big* list of objects (approx 50k).
Each object has some various fields and a unique name (the 6th column of the ListView)
We'd like TestComplete to be able to select a specific object in this list using it's name,
but as of now, we've been unable to find a solution that is fast enough to be really usable.
Currently we are using a suboptimal loop (DelphiScript) :
for i := 0 to formSel.ListView.wItemCount-1 do begin
// Obtains Object Name
s := formSel.ListView.wItem[formSel.ListView.ItemIndex,5];
if (aqString.Contains(s, TargetName, 0, False) >= 0) then begin
formSel.ListView.ClickItem(i);
bSuccess := True;
break;
end else begin
formSel.ListView.Keys('[Down]');
s := '';
end;
end;
(which takes ages to reach the bottom of the list)
According to the documentation, the Obvious ListView.SelectItem() seems to be searching only on the first column (column 0) which does not suit our need; ListView.ClickItem() seems to follow the same pattern.
Did we miss an obvious point ? or did someone find a clever way to workaround this kind of issue ? Is this kind of scenario supported ? Is there a simple way we can make this happen within reasonable delay ?
Thanks for your help and advice !
For one of our projects (Delphi), we are using a TListView component to display a *big* list of objects (approx 50k).
Each object has some various fields and a unique name (the 6th column of the ListView)
We'd like TestComplete to be able to select a specific object in this list using it's name,
but as of now, we've been unable to find a solution that is fast enough to be really usable.
Currently we are using a suboptimal loop (DelphiScript) :
for i := 0 to formSel.ListView.wItemCount-1 do begin
// Obtains Object Name
s := formSel.ListView.wItem[formSel.ListView.ItemIndex,5];
if (aqString.Contains(s, TargetName, 0, False) >= 0) then begin
formSel.ListView.ClickItem(i);
bSuccess := True;
break;
end else begin
formSel.ListView.Keys('[Down]');
s := '';
end;
end;
(which takes ages to reach the bottom of the list)
According to the documentation, the Obvious ListView.SelectItem() seems to be searching only on the first column (column 0) which does not suit our need; ListView.ClickItem() seems to follow the same pattern.
Did we miss an obvious point ? or did someone find a clever way to workaround this kind of issue ? Is this kind of scenario supported ? Is there a simple way we can make this happen within reasonable delay ?
Thanks for your help and advice !