cancel
Showing results for 
Search instead for 
Did you mean: 

Ensure FindChild is being used correctly

SOLVED
ackmondual
Contributor

Ensure FindChild is being used correctly

I'm testing an Android application using TestComplete 14.

 

I'm trying to see if I can use the FindChild function in the Object Browser, to see if I can reference objects that Object Spy cannot find (even though they're visible on the screen).  No success.

 

I decided to see if I can use the same FindChild function in the same Object Browser, to see if I can reference objects that I know for sure work.  Still no success.

 

For the first 2 parameters of FindChild (PropNamesPropValues), these should correspond to the "ObjectType" and the "ViewID" fields, under the Extended section, when you open that object right?

1 ACCEPTED SOLUTION

Accepted Solutions
ackmondual
Contributor

Re: Ensure FindChild is being used correctly

The developers have mentioned that it likely has something to do with the way they implemented that section of the screen (that contains those buttons that can't be picked up).  They should be able to issue a fix for it.  I did want to ensure I've looked into all options on my end.

 

Thanks for the replies!  If you or anyone else have anything to add, please continue to post!

View solution in original post

8 REPLIES 8
AlexKaras
Community Hero

Re: Ensure FindChild is being used correctly

Hi,

 

if I can use the FindChild function in the Object Browser

.FindChild() method cannot be used in Object Spy and/or Object Browser but in test code/keyword test only.

 

if I can reference objects that Object Spy cannot find

If some object is not present in the objects tree in Object Browser then .FindChild() will not be able to find this object either.

 

Can you provide a screenshot that will demonstrate the object present on mobile screen and absent in the Object Browser's tree?

 

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
================================
ackmondual
Contributor

Re: Ensure FindChild is being used correctly

if I can reference objects that Object Spy cannot find

If some object is not present in the objects tree in Object Browser then .FindChild() will not be able to find this object either.

 

Can you provide a screenshot that will demonstrate the object present on mobile screen and absent in the Object Browser's tree?

 

Some clarifications to ensure we're talking about the same thing...

The button is there in the Object Browser tree view (from a previous screen recording run through)

 

When I use Object Spy to try to highlight that button (by hovering mouse cursor over it), it can't recognize it (the red rectangle cannot get around the button.  Only a large area around it).  The user can still manually tap on that button to activate it, even if TC can't recognize it.

 

Unfortunately, I am NOT permitted to upload screenshots of the software.

AlexKaras
Community Hero

Re: Ensure FindChild is being used correctly

Hi,

 

Is this a native (Java?) Android application or Web/Hybrid one?

 

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
================================
ackmondual
Contributor

Re: Ensure FindChild is being used correctly

The former... native (Java?) Android application

AlexKaras
Community Hero

Re: Ensure FindChild is being used correctly

Hi,

 

When I use Object Spy to try to highlight that button (by hovering mouse cursor over it), it can't recognize it

If some object cannot be recognized by the Object Browser/Object Spy then none of .FindXXX() methods will be able to find it either.

As you are testing native Java application, is it prepared as per https://support.smartbear.com/testcomplete/docs/app-testing/mobile/android/preparing/instrumenting-a... ?

 

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
================================
ackmondual
Contributor

Re: Ensure FindChild is being used correctly

It is.  Instrumented through TestComplete itself.

 

For better and for worse, it sounds like the .FindChild() function is indeed working as it's supposed to be. 

 

That leads to the question... Is there a function that can actually reference objects in the Object Browswer (via scripting)?  These objects are visible while in use by humans and can be manually tapped on, but using Object Spy won't be able to distinguish them

AlexKaras
Community Hero

Re: Ensure FindChild is being used correctly

Hi,

 

Is there a function that can actually reference objects in the Object Browswer (via scripting)?

No as per my knowledge.

It is my understanding that all regular objects for Java application should be accessible to Object Browser unless developers somehow explicitly restricted access to some of them. So you may talk to your developers and ask them for the possible reason if the object you are talking about is the only one that is not recognized by the Object Browser. 

If nothing helps I would create Support ticket via the https://support.smartbear.com/testcomplete/message/ form.

I will appreciate it if you update this thread with the answer from either your developers or Support.

 

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
================================
ackmondual
Contributor

Re: Ensure FindChild is being used correctly

The developers have mentioned that it likely has something to do with the way they implemented that section of the screen (that contains those buttons that can't be picked up).  They should be able to issue a fix for it.  I did want to ensure I've looked into all options on my end.

 

Thanks for the replies!  If you or anyone else have anything to add, please continue to post!

View solution in original post

New Here?
Join us and watch the welcome video:
Top Kudoed Authors