cancel
Showing results for 
Search instead for 
Did you mean: 

Find child - comSafe Array

SOLVED
Highlighted
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! 

1 ACCEPTED SOLUTION

Accepted Solutions
Highlighted
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.

View solution in original post

5 REPLIES 5
Highlighted
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.

View solution in original post

Highlighted
Community Hero

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 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.
https://community.smartbear.com/t5/custom/page/page-id/hall-of-fame
================================
Highlighted
Contributor

Hello, 

 

I'm using javascript. 

 

Thanks 

Highlighted
Contributor

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. 

Highlighted
Frequent Contributor

Great to hear that Find worked well for you.

 

New Here?
Join us and watch the welcome video:
Announcements
Join TechCorner Challenge!
Want a fun and easy way to learn TestComplete? Try solving weekly TechCorner challenges and get into the Leaderboard!


Challenge Status

Get properties of a web page element

See replies!

Compare images using the Region Checkpoint

See replies!

Compare HTML table with Excel file and correct data in Excel file

Participate!

How to execute remote test and obtain results via Test Runner REST API

Participate!
Top Kudoed Authors