Find child - comSafe Array
I'm using the wnd caption with a find child statement to find a window in our software. The Find Child statement is returning the window as a comSafeArray object. I'm confused about this result. Properties of the object are now part of elements of the window. Is there an issue with how I used the findChild statement?
var property = "WndCaption"
var objWnd = ritSysObj.FindAllChildren(property,strCaption,3)
Thanks in advance!
Solved! Go to Solution.
Can you please try once with Find instead of FindAllChildren
var objWnd = ritSysObj.Find(property,strCaption,3)
Please let me know whether that works.
What scripting language you are using?
If it is JScript, then you should use .toArray() (see documentation for more details).
var objWnd = ritSysObj.FindAllChildren(property,strCaption,3).toArray();
/Alex [Community Hero]
[Community Heroes] are not employed by SmartBear Software but
are just volunteers who have some experience with the tools by SmartBear Software
and a desire to help others. Posts made by [Community Heroes]
may differ from the official policies of SmartBear Software and should be treated
as the own private opinion of their authors and under no circumstances as an
official answer from SmartBear Software.
The [Community Hero] signature is used with permission by SmartBear Software.
The "Find" command worked! Much appreciated!
I'm guessing that I was encountering some king of process hierarchy issue. From what I understand, FindChild searches child objects while Find also searches the Tested object, or System process object in my case.
Great to hear that Find worked well for you.