Forum Discussion
SimpleMe
Occasional Contributor
Thanks. I think I'm doing something wrong with your example. Here is how I'm trying to use it:
def Status_Find_Touch(): target_CollectionView = Mobile.Device("iPad").Process("MyApp").Window(0).CollectionView(3) #'Label (is ObjectType)', 'ObjectText (property of the label)' I think I have this part setup correctly target_Label = target_CollectionView.Find( ['Label', 'Enroute'], #'Label', 'mappedname?') This is the part I think I have wrong ['Label', 'MappedNameOfLabel'], 3) target_Label.Touch()
When I run it I'm receiving an error "You are trying to call the "Touch" method or property of an object that does not exist."
baxatob
7 years agoCommunity Hero
If I correctly understood, your code now looks like:
target_Label = target_CollectionView.Find( ['Label', 'Enroute'], ['Label', 'MappedNameOfLabel'], 3)
['Label', 'Enroute'] - first array should contain the names of the properties
['Label', 'MappedNameOfLabel'] - and the second array - the values of those properties.
If you want to find a label only by its name (using only ONE property), you can use:
target_Label = target_CollectionView.Find('ObjectText', 'Enroute', 3)
More details here: https://support.smartbear.com/testcomplete/docs/reference/test-objects/members/common-for-all/find-method.html
Related Content
Recent Discussions
- 9 hours agodhundley