austgl / robotium

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

ScrollUp does not happen for searchText but only scrollDown, how to find a text on top of the view? #166

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. searchText does not scroll up to search the test
2. use searchText to find a text that is well below the current view
then use searchText again which is at the top of the view which can be seen 
only if scrolling upwards is done. 
3.

What is the expected output? What do you see instead?
Expect scrollUp() / scrollDown() to be performed until the text is found. 
ScrollUp() does not occur and the test fails unable to find the text at the top 
that is not visible on the current view but could be seen only by scrolling

What version of the product are you using? On what operating system?
solo2.2, Emulator with Google API 8.

Please provide any additional information below.

Original issue reported on code.google.com by pr...@anvaya.net on 27 Sep 2011 at 11:41

GoogleCodeExporter commented 9 years ago
You will have to scroll up your self after using searchText the first time. 
scrollUp/scrollDown will give you false back when it is not able to scroll 
anymore. So you test case could look something like this:

solo.searchText();
while(solo.scrollUp());
solo.searchText();

Original comment by renasr...@gmail.com on 28 Sep 2011 at 6:21

GoogleCodeExporter commented 9 years ago
solo.searchText();
while(solo.scrollUp());
solo.searchText();

i invalid. I tried this before I entered the issue. The reason it is invalid is 
because:
while loop scrolls up first.
Then searchtext makes the scroll down automatically.
So basically the same view is been checked endless between scroll up and search 
text. ScrollUp goes up one view, while searchtext brings down one view 
searching for text and while loop continues endlessly. This solution did not 
work.

Original comment by pr...@anvaya.net on 28 Sep 2011 at 10:47

GoogleCodeExporter commented 9 years ago
Use searchText with the parameter set to false.  You can find the different 
options in the javadoc. 

Original comment by renasr...@gmail.com on 29 Sep 2011 at 2:54