Ask a Question

Forcing TestComplete to touch an object even if not topmost

altus_nel
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
TanyaYatskovska
SmartBear Alumni (Retired)

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 Yatskovskaya
SmartBear Community and Education Manager



altus_nel
Contributor

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.
TanyaYatskovska
SmartBear Alumni (Retired)

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 Yatskovskaya
SmartBear Community and Education Manager



altus_nel
Contributor

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.

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.

 

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 Champion]
____
[Community Champions] 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 Champions]
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 Champion] signature is assigned on quarterly basis and is used with permission by SmartBear Software.
https://community.smartbear.com/t5/Community-Champions/About-the-Community-Champions-Program/gpm-p/252662
================================


@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. 

and..?

What actually does not work?

What have you tried and what was the result?

 

Regards,
  /Alex [Community Champion]
____
[Community Champions] 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 Champions]
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 Champion] signature is assigned on quarterly basis and is used with permission by SmartBear Software.
https://community.smartbear.com/t5/Community-Champions/About-the-Community-Champions-Program/gpm-p/252662
================================
gandrew
Occasional Visitor

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

cancel
Showing results for 
Search instead for 
Did you mean: