cancel
Showing results for 
Search instead for 
Did you mean: 

Handle native pop ups with Object Spy

SOLVED
Highlighted
Contributor

Handle native pop ups with Object Spy

Hello !

 

In the app that I am testing, there are native pop ups that cannot be accessed by Object Spy.

Previous, the pop ups were accessible. Now that they have been changed, Object Spy does not look up for them.

I tried accessing them from the main view, but still there are not visible as Child to other parent controls.

 

Do you have some experience with this issue?

 

Thank you

2 ACCEPTED SOLUTIONS

Accepted Solutions
Community Hero

Re: Handle native pop ups with Object Spy

Hi,

 

> Now that they have been changed, Object Spy does not look up for them.

This tells us nothing. How these popups were implemented previously? What were they changed to? You need to talk to developers or find out details in some other way.

If now popups are implemented as toasts, then https://community.smartbear.com/t5/TestComplete-Mobile-Application/Android-Toast-test/m-p/92439/high... and https://community.smartbear.com/t5/TestComplete-Mobile-Application/Forcing-TestComplete-to-touch-an-... might help.

 

Regards,
Alex
[Community Expert Group]
____
[Community Expert Group] members 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. Postings made by [Community Expert Group] members
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.
[Community Expert Group] signature is used with permission by SmartBear Software.
http://smartbear.com/forums/f83/t86934/community-experts/
================================
Community Hero

Re: Handle native pop ups with Object Spy

> The application is instrumented.

And that is why you can access its internals with TestComplete.

But toasts do not belong to your application. Toasts are native system entities that are called by your application and provided by the OS. They are not instrumented (and cannot be, at least at the moment). This is the reason of why toasts (and their child controls) are absent in the Object Browser.

 

Regards,
Alex
[Community Expert Group]
____
[Community Expert Group] members 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. Postings made by [Community Expert Group] members
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.
[Community Expert Group] signature is used with permission by SmartBear Software.
http://smartbear.com/forums/f83/t86934/community-experts/
================================
7 REPLIES 7
Community Hero

Re: Handle native pop ups with Object Spy

Hi,

 

> Now that they have been changed, Object Spy does not look up for them.

This tells us nothing. How these popups were implemented previously? What were they changed to? You need to talk to developers or find out details in some other way.

If now popups are implemented as toasts, then https://community.smartbear.com/t5/TestComplete-Mobile-Application/Android-Toast-test/m-p/92439/high... and https://community.smartbear.com/t5/TestComplete-Mobile-Application/Forcing-TestComplete-to-touch-an-... might help.

 

Regards,
Alex
[Community Expert Group]
____
[Community Expert Group] members 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. Postings made by [Community Expert Group] members
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.
[Community Expert Group] signature is used with permission by SmartBear Software.
http://smartbear.com/forums/f83/t86934/community-experts/
================================
Contributor

Re: Handle native pop ups with Object Spy

Cam I access some controls inside the pop up?

Community Hero

Re: Handle native pop ups with Object Spy

Cam I access some controls inside the pop up?

What pop up?

 

Regards,
Alex
[Community Expert Group]
____
[Community Expert Group] members 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. Postings made by [Community Expert Group] members
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.
[Community Expert Group] signature is used with permission by SmartBear Software.
http://smartbear.com/forums/f83/t86934/community-experts/
================================
Contributor

Re: Handle native pop ups with Object Spy

The pop up made as toast has controls that can be accessed Yes, No, OK Cancel buttons and I was ondering if I can access the controls. Inside the upper layer there is a method FindId that takes an int as parameter. If the Ids would be set to the pop up and its controls, this might work.

 

Thanks

Community Hero

Re: Handle native pop ups with Object Spy

Hi,

 

> The pop up made as toast 

Tested application must be instrumented in order TestComplete can access its internals. Toasts are system objects and thus I am far not sure that their internals can be made accessible to TestComplete.

What I would do in this case is wait for the toast to appear with the help of the .WaitForControlWithText() and then use Image-Based testing (https://support.smartbear.com/testcomplete/docs/app-testing/mobile/android/image-based-testing.html) to find and touch required button.

 

You may also create a Support ticket via the https://support.smartbear.com/message/?prod=TestComplete form and ask if guys can suggest some better approach.

 

Regards,
Alex
[Community Expert Group]
____
[Community Expert Group] members 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. Postings made by [Community Expert Group] members
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.
[Community Expert Group] signature is used with permission by SmartBear Software.
http://smartbear.com/forums/f83/t86934/community-experts/
================================
Contributor

Re: Handle native pop ups with Object Spy

The application is instrumented. I have access to other controls, except these native pop ups.

The solution with WaitForControlWithText works, but, since the control is not accessible, I cannot access it's children.

 

Is there a method for instance I saw soething like FindId() which requires an ID int ?

Do you know how to get the Object to have access to its children.

 

Regards,

Community Hero

Re: Handle native pop ups with Object Spy

> The application is instrumented.

And that is why you can access its internals with TestComplete.

But toasts do not belong to your application. Toasts are native system entities that are called by your application and provided by the OS. They are not instrumented (and cannot be, at least at the moment). This is the reason of why toasts (and their child controls) are absent in the Object Browser.

 

Regards,
Alex
[Community Expert Group]
____
[Community Expert Group] members 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. Postings made by [Community Expert Group] members
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.
[Community Expert Group] signature is used with permission by SmartBear Software.
http://smartbear.com/forums/f83/t86934/community-experts/
================================
New Here?
Join us and watch the welcome video:
Top Kudoed Authors