Find child - comSafe Array
SOLVED- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Find child - comSafe Array
Hello,
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)
Log.Picture(objWnd)
Thanks in advance!
Solved! Go to Solution.
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Can you please try once with Find instead of FindAllChildren
var objWnd = ritSysObj.Find(property,strCaption,3)
Please let me know whether that works.
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi,
What scripting language you are using?
If it is JScript, then you should use .toArray() (see documentation for more details).
I.e.:
var objWnd = ritSysObj.FindAllChildren(property,strCaption,3).toArray();
/Alex [Community Champion]
____
[Community Champions] 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 Champions]
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 Champion] signature is assigned on quarterly basis and is used with permission by SmartBear Software.
https://community.smartbear.com/t5/Community-Champions/About-the-Community-Champions-Program/gpm-p/252662
================================
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hello,
I'm using javascript.
Thanks
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hello,
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.
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Great to hear that Find worked well for you.
