Ask a Question

List view items

New Contributor

List view items

Hi everyone,


I'm new to TestComplete and i'm having problems with list view control. I am using TestComplete to test .NET based application.




I'm trying to find a specific item in list view control and I was helping with the example on this link:




Function checkValueExists(listView, value)
Dim i, j
For i = 0 To listView.Columns.Count - 1
For j = 0 To listView.Items.Count - 1
If listView.Items(j,i) = value Then
checkValueExists = True
Exit Function
End If
checkValueExists = False
End Function



When using this function it gives back an error:


Wrong number of arguments or invalid property assignment: 'listView.Items' 



Valued Contributor

The example provided is using extended properties of the listview item and your code is not.

The error message you are receiving is correct.


You need to trace it to the line of code that is generating the error and verify that you are passing the correct number of parameters to the property or method.


More than likely this is incorrect:


If listView.Items(j,i) = value Then


Try using the object spy to verify the number of parameters accepted by listView.Items (and that it is actually the property you want to check).

''-Praise the sun and Give Kudos.''



I decided to try something else - my goal is to print entire listView.


I've tried almost everything to just print at least one of the element in listView, but nothing seems to work, 


I tried using spy to verify the number of parameters accepted by listView.Items, but I guess i'm doing something wrong.


For example: calling method listView.Items.Count and listView.Colums.Count is working OK. So how can I print an item (I want to get string in log message or in a .txt file) in a specific row and column?




The example you linked to is a Delphi one.


You mentioned your control is a .NET one.


They may well not have the same properties. (And Delphi also has numerous different types of Listview/Dropdown control types which all behave slightly differently)


What's the class of the control you're trying to get the list items from?


Printscreen in attachment.

Valued Contributor

Can you post a screenshot of the entire object spy showing all extended/advanced properties for your listview?

''-Praise the sun and Give Kudos.''
Showing results for 
Search instead for 
Did you mean: