cancel
Showing results for 
Search instead for 
Did you mean: 

Forcing TestComplete to touch an object even if not topmost

Highlighted
Contributor

Forcing TestComplete to touch an object even if not topmost

Hi there.



I've come accross a problem whilst testing Android toasts. The problem is as follows. For a given screen (activity) if certain information is not entered while navigatiing away from the object, a toast is generated by the application informing the user of required information. Now, I want this to happen since i can then use a region checkpoint to verify that the toast is displayed. 



The problem that i have now is, is that TestComplete does not want to navigate to another control since it seems to think that the activity has been moved to the background (which it isn't).



Is there a way to force TestComplete to touch the control even if it's not topmost?
10 REPLIES 10
Highlighted
Community Manager

RE: Forcing TestComplete to touch an object even if not topmost

Hi Altus,

 


Try calling the Refresh method of one of the parent objects after the toast message appears, but before you start working with it.


 

---------
Tanya Gorbunova
SmartBear Community Manager

Learn SmartBear products in a fun and easy way and prove your knowledge!
>>Participate in the TechCorner Challenge today
Highlighted
Contributor

RE: Forcing TestComplete to touch an object even if not topmost

HI Tanya,



Thanks for the reply. Alas, refreshing the parent object does not resolve the issue. Still cannot the "touch" the object.



However, a workaround for this is to simply simulate a touch (with x y coordinates) somewhere on the screen (Device Touch). This removes the toast for the object and allows normal ineraction with the other objects.



Thanks for taking the time to reply to this. 



Regards.
Highlighted
Community Manager

RE: Forcing TestComplete to touch an object even if not topmost

Hi Altus,

 


I'm glad that you found a way to overcome this situation. I have one more suggestion for you - try calling the WaitActivity method to wait until the toast disappears, and you can continue executing a test.


 

---------
Tanya Gorbunova
SmartBear Community Manager

Learn SmartBear products in a fun and easy way and prove your knowledge!
>>Participate in the TechCorner Challenge today
Highlighted
Contributor

RE: Forcing TestComplete to touch an object even if not topmost

Hi Tanya,



Unfortunately the WaitActivity will also not yield any result since the toast is only dismissed when data is entered for the applicable EditText android control. 



If i do come across something (other than the workaround) I'll be sure to post it here since i'm sure this will be something that other testers will be running into as well at some point in time.



Best Regards.
Highlighted
Contributor

Re: RE: Forcing TestComplete to touch an object even if not topmost

Hi , I am automating Tests for a hybrid mobile application. However I can find the object from the web page ,I am not able to Touch() or Keys(string) on the object although I can see the methods available for the object.

 

ALso is there anyone else who has faced the issue like ,individual UI elements are not being highlighted on the web pages inside the hybrid application from object spy.

 

To note- I am opening my web app inside the native smartBearBrowser.apk.

 

Thanks.

 

Highlighted
Community Hero

Re: RE: Forcing TestComplete to touch an object even if not topmost

Hi,

 

Is this a new problem or it has been already solved as mentioned here: https://community.smartbear.com/t5/TestComplete-Mobile-Application/Object-spy-can-not-find-the-objec... ?

If this is a new problem, is it about .Touch() method that this thread is devoted to or about something else?

 

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
Occasional Visitor

Re: RE: Forcing TestComplete to touch an object even if not topmost


@AlexKaras wrote:

Hi,

 

Is this a new problem or it has been already solved as mentioned here: https://community.smartbear.com/t5/TestComplete-Mobile-Application/Object-spy-can-not-find-the-objec... krogerfeedback?

If this is a new problem, is it about .Touch() method that this thread is devoted to or about something else?

 


 The problem is as follows. For a given screen (activity) if certain information is not entered while navigatiing away from the object, a toast is generated by the application informing the user of required information. Now, I want this to happen since i can then use a region checkpoint to verify that the toast is displayed. 

Highlighted
Community Hero

Re: RE: Forcing TestComplete to touch an object even if not topmost

and..?

What actually does not work?

What have you tried and what was the result?

 

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
Occasional Visitor

Re: RE: Forcing TestComplete to touch an object even if not topmost

I am stuck with the same problem and thought i would get help from here but still can not figure out the solution mcdvoice 

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

Compare images using the Region Checkpoint

See replies!

Converting UTC TimeDate in an Excel file

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