austgl / robotium

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

searchText issue with big layouts #182

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1.Have a big layout with textviews inside and put in in a scrollview
2.Search for a text that is visibile only if you scroll down the layout

What is the expected output? What do you see instead?
Expected: true, Get: false

What version of the product are you using? On what operating system?
3.0 (same problem on 2.5). Android 2.3 - Desire HD

Please provide any additional information below.
This is especialy strange since if i search for texts visible only if scroll 
right it works (because the isViewSufficientlyShown method from ViewFetcher 
check only that the view to be visible on the Y-axis)
I checked the code and it seems that the searchFor method from the Searcher use 
the getCurrentViews method from the ViewFetcher (which returns only visible 
views). I think it should use the getAllViews(false) method since the non 
visible views should be removed only if the onlyVisible flag is true (wich is 
done anyway by: RobotiumUtils.removeInvisibleViews)

Original issue reported on code.google.com by amarkov...@gmail.com on 15 Nov 2011 at 3:01

GoogleCodeExporter commented 9 years ago
Thanks for this. Does it scroll when first not finding the text?

Original comment by renasr...@gmail.com on 15 Nov 2011 at 3:15

GoogleCodeExporter commented 9 years ago
No, no scroll is made.
Also i use a custom view for scrolling since i need scrolling bot vertically 
and horizontally. Can this be the issue?

Andrei

Original comment by amarkov...@gmail.com on 15 Nov 2011 at 3:20

GoogleCodeExporter commented 9 years ago
This is the scroll view used: 
http://blog.gorges.us/wp-content/uploads/TwoDScrollView.java

Original comment by amarkov...@gmail.com on 15 Nov 2011 at 3:23

GoogleCodeExporter commented 9 years ago
The problem here is that scrollDown() only checks if your using a scroll view 
or a list view (also extending them with custom views). That is why it does not 
scroll as it only finds a framelayout. Right now there is no plan to change 
that behaviour as it would be hard to determine when a framelayout can scroll 
or not. 

The best thing would be if you can change your custom view so that it extends a 
scroll view and then add the changes needed in your custom scroll view instead. 

Original comment by renasr...@gmail.com on 15 Nov 2011 at 3:32

GoogleCodeExporter commented 9 years ago
Also what happens if i have for example a listview and also a scroll view in my 
layout: will the search scroll all of them searching for my text?

Original comment by amarkov...@gmail.com on 15 Nov 2011 at 3:32

GoogleCodeExporter commented 9 years ago
The ones that are visible will be scrolled yes. It will first scroll down the 
scroll view and then the list view (if that is the setup) If you for example 
have an application with tabs you will need to first click the right tab and 
then search. Its not possible to add this behaviour for a framelayout though as 
every custom version of the framelayout will have its own special way of 
scrolling (which robotium will not know about). 

Original comment by renasr...@gmail.com on 15 Nov 2011 at 3:38