stephenwang1011 / robotium

Automatically exported from code.google.com/p/robotium
0 stars 0 forks source link

removeInvisibleViews() method in RobotiumUtils removes views that are visible to user #315

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
Hi,

I started using Robotium to test our App and came accross this issue where the 
removeInvisibleViews() method in RobotiumUtils class seems to be removing views 
that are currently visible on screen.

the problem seems to be the following line (line number 81) in RobotiumUtils 
class i.e. 
if (view != null && view.isShown()).

Changing the above line to..
if (view != null && view.getVisibility() == View.VISIBLE)
fixed the issue for me. Could you guys take a look and see what could be 
happening.

Thanks,
Ashwin

Original issue reported on code.google.com by ash....@gmail.com on 23 Aug 2012 at 2:52

GoogleCodeExporter commented 9 years ago
Please see this issue on why the behaviour changed from only checking the view 
itself to changing it to isShown() that also checks with the views ancestors. 

http://code.google.com/p/robotium/issues/detail?id=128&can=1&q=isShown)&colspec=
ID%20Type%20Stars%20Status%20Priority%20Milestone%20Owner%20Summary

Original comment by renasr...@gmail.com on 23 Aug 2012 at 11:15

GoogleCodeExporter commented 9 years ago
Thanks for the quick response. I am surprised that no one else has seen this 
problem. 

I just want to give you a little more description as to how Robotium is 
behaving and why I think there is a bug in the current implementation..

The App I am working with implements a 'Viewpager' control and has two pages 
(say Page 1 and Page 2) and each page has two 'EditText' controls. when the App 
launches Page 1 is always displayed to the user and the user has the option to 
swipe to Page 2. 

With Page 1 displayed, when I call robotium..
solo.enterText(0, "test")

robotium actually enters the text in the 'EditText' control on the Page 2, 
that's not visible to me on the device. I tried debugging the robotium code and 
noticed that the removeInvisibleViews() method in RobotiumUtils removes all the 
controls on Page 1 (which are currently visible to me)

Original comment by ash....@gmail.com on 23 Aug 2012 at 8:00

GoogleCodeExporter commented 9 years ago
I have the same problem.  When I use isShown(), all the TextView visible to me 
are yanked out.  

Original comment by elebeau%...@gtempaccount.com on 10 Oct 2012 at 7:05

GoogleCodeExporter commented 9 years ago
What version of Android are you running on?

Original comment by renasr...@gmail.com on 10 Oct 2012 at 7:11