cancel
Showing results for 
Search instead for 
Did you mean: 

Which function should I use to detect if a button on-screen is detectable or not with Object Spy?

SOLVED
Highlighted
Occasional Contributor

Which function should I use to detect if a button on-screen is detectable or not with Object Spy?

Windows 10

TC Version: 14.0.317.7 x64

Android device on Android 7.1.1

 

I guess due to the way the app was written, a button that's on screen and visible (to human eyes), regardless whether or not another view/fragment is open.  However, Object Spy can only detect that button if that other view is open (something about that view obscures an area of the screen and everything underneath it).

 

I'm trying to figure out how what function or call I can use to detect whether or not Object Spy would be able to pick it up (so I can code a condition that if ObjectSpy can't find it, then I need to open that other view before I can tap on that button).  Visible and Exists always returns true, so they don't seem to be it.

1 ACCEPTED SOLUTION

Accepted Solutions
Highlighted
Community Hero

Re: Which function should I use to detect if a button on-screen is detectable or not with Object Spy

Hi,

 

Object Spy does not provide any additional API to control its 'sensitivity'. Object Spy either can identify an object or not.

You may consider two options:

a) Try to figure out a set of properties that will indicate that the second view is open and overlaps the button. So you will be able to determine whether or not the button can be tapped;

b) Use the Object Browser and try to identify the view and button when they are overlapped and, again, try to figure out the properties that will indicate that the view/button cannot be tapped.

 

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

View solution in original post

1 REPLY 1
Highlighted
Community Hero

Re: Which function should I use to detect if a button on-screen is detectable or not with Object Spy

Hi,

 

Object Spy does not provide any additional API to control its 'sensitivity'. Object Spy either can identify an object or not.

You may consider two options:

a) Try to figure out a set of properties that will indicate that the second view is open and overlaps the button. So you will be able to determine whether or not the button can be tapped;

b) Use the Object Browser and try to identify the view and button when they are overlapped and, again, try to figure out the properties that will indicate that the view/button cannot be tapped.

 

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

View solution in original post

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!

Challenge Status

Changing options from outside of TestComplete

Participate!

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

Participate!

Comparing content of HTML table with Excel file data

Participate!

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

Participate!
Top Kudoed Authors