Forum Discussion

OAn's avatar
OAn
Contributor
4 years ago
Solved

ListView - GetCell() method

Hi,

 

I'm using TestComplete Version: 14.90.432.7 x64 with DelphIScript. The tested application is developed with C#.

Does anyone used GetCell method for a ListView control? The function format get it from Object Spy is: function GetCell(Framework.UI.HeaderItem; line : Integer; column : Integer; Framework.UI.ItemTextEventArgs; PrintContext : SystemString) : System.String;

While I did figured the first three parameters, for the last two(Framework.UI.ItemTextEventArgs; PrintContext : SystemString) I cannot see where can I find them, they are not straightforward methods within ListView Object Spy.

 

I can give you a clue from a similar method function for the same control, which is GetCellNumericValue(Framework.UI.HeaderItem; line : Integer; HeaderIndex: Integer; bWasException : ref System.Boolean) : Real; I have successfully used this one and indeed returns only a number: for instance, if you use it on a ListView column with strings, it will return value 0, while for a column with numbers, it return the number at the specified position within ListView's table.

A real example is this one: ListViewdObj.GetCellNumericValue(ListViewdObj.HeaderItems.Item[4],2,4,False);

 

Thank you.

7 Replies

  • AlexKaras's avatar
    AlexKaras
    Icon for Champion Level 2 rankChampion Level 2

    Hi,

     

    or the last two [...] I cannot see where can I find them

    Just a wild guess: what if you pass nil for these last two parameters?

     

    • OAn's avatar
      OAn
      Contributor

      Thank you, Alex. It doesn't like it. It will throw an "Unknown error". In fact I've tried quite a few combinations and this is the most "friendly" error I could get.

      • AlexKaras's avatar
        AlexKaras
        Icon for Champion Level 2 rankChampion Level 2

        Hi,

         

        Any chance to talk to developers and ask them for the code sample in C# ?

        Considering that the tested application in in C# and thus is accessible to TestComplete, I would expect that it will be possible to port their sample into DelphiScript.