Forum Discussion
Can you share an example of your attempt to use FindChild that is not working? I don't think the problem is necessarily in FindChild, but perhaps simply in finding the correct properties to work with.
PropArray = new Array("ObjectType", "idStr", "ObjectIdentifier", "className"); ValuesArray = new Array("Textbox", "menuSearch", "menuSearch", "menuSearchReady"); // Find the cell where the link/button resides var textbox = AnyPage["Find"](PropArray, ValuesArray, 1000);
This didn't reliably replay, so we decided to drop the ObjectIdentifier & className.
PropArray = new Array("ObjectType", "idStr"); ValuesArray = new Array("Textbox", "menu-search-input"); // Find the cell where the link/button resides var textbox = AnyPage["Find"](PropArray, ValuesArray, 1000);
This didn't replay 100% of the time either... probably 95-98% of the time, but it was an improvement over the 85-90% we started with.
- tristaanogre7 years agoEsteemed Contributor
Try changing from FindChild to FindChildEx with an additional parameter for timeout (see my example above)
- tristaanogre7 years agoEsteemed Contributor
Note, also, that before I do anything with the object I'm searching for, I always check the "Exists" property... FindChild and FindChildEx will ALWAYS return an object with that property... if it doesn't find what you're looking for, that "stub" object has an Exists property with a value of "false" so this is an easy way to check if you found what you're looking for without TestComplete complaining about "Object not found" or "cannot call a method on undefined" or something like that.
- bo_roop7 years agoContributor
FindChildEx appears to be working fine... now to go send it off through our array of Virtual Machines to see if it's working better there too.
Thanks!
Hopefully we won't have to revisit this on Monday. :)
Related Content
Recent Discussions
- 2 days agovladd1