Ask a Question

Find child - comSafe Array

SOLVED
SuperTester
Contributor

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)

 

kahle_0-1597354516450.png

 

 

Thanks in advance! 

5 REPLIES 5
anupamchampati
Frequent Contributor

Can you please try once with Find instead of FindAllChildren

var objWnd = ritSysObj.Find(property,strCaption,3)

 

Please let me know whether that works.

AlexKaras
Champion Level 2

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();

 

Regards,
  /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
================================

Hello, 

 

I'm using javascript. 

 

Thanks 

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. 

Great to hear that Find worked well for you.

 

cancel
Showing results for 
Search instead for 
Did you mean: