Forum Discussion
Should the "True" values be in ""?
I have a feeling they shouldn't. Try removing the "" from around all the True's in your ValuesArray and see what it returns.
Also, have you put a breakpoint on this and inspected the object within the array of results FindAllChildren is generating? What are are the fields in there that you're not expecting?
- DevPerera9 years agoOccasional Contributor
Hi Colin,
I tried your suggestion but its not work.
Then I change my code to see all the results its been count as objects.
By looking at the results I can see its duplicate the objects.
Ex; If only one object found then its dispay as two like wise.
System results attach here with.
Modified code as below.
Sub ObjCounts
PropArray = Array("ObjectType", "Exists", "VisibleOnScreen", "Visible", "Enabled")
ValuesArray = Array("Textbox", "True", "True", "True", "True")
obj = Sys.Browser("iexplore").FindAllChildren(PropArray, ValuesArray,2000)
If UBound(obj) > 0 Then
Log.Message("Total number of text fields : " & (UBound(obj)+1))
For i = 0 To UBound(obj)
Log.Message("Object_ID:" & i & "; ObjectType: " & obj(i).ObjectType & ", ObjectIdentifier: " & obj(i).ObjectIdentifier)
Next
Else
Log.Warning("No text fields found!")
End If
End Sub- Colin_McCrae9 years agoCommunity Hero
OK.
So if it's finding duplicates, have you looked at the object model for the application in the object browser? I'm not sure how FindAllChildren can be returning duplicates if you are using VisibleOnScreen (True) as a search value.
Are the duplicates present in the object browser?
Or it could just be the page. I've had a webpage in the past where Chrome was showing duplicates in the Object Model, but IE didn't.
Hard to say without actually seeing the webpage you're looking at ...
- DevPerera9 years agoOccasional Contributor
Hi Colin,
Thanks for the repley. I divide the total number by two which return by object counter.
Ex; if a page contain object count as one, then function return as two, then I divide that value by two to get correct.
------------
Thanks
Dev
Related Content
- 6 months agomacheshmeh
Recent Discussions
- 2 days agovladd1