austgl / robotium

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

scrollDownList always scrolls list with index 0 #123

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. Build a UI with 2 different listviews
2. Call scrollDownList(1)
3. The first ListView is scrolled instead of the second one

What is the expected output? What do you see instead?
To scroll the second ListView

What version of the product are you using? On what operating system?
2.3, Linux, Windows

Please provide any additional information below.

Looking at the source:

 * Scrolls down a list with a given index.
     * 
     * @param index the {@link ListView} to be scrolled. {@code 0} if only one list is available
     * @return {@code true} if more scrolling can be done
     * 
     */

    public boolean scrollDownList(int index) {
        waiter.waitForView(ListView.class, index);
        return scroller.scrollList(ListView.class, 0, Scroller.DOWN, null);
    }

The scroller always calls index 0 cause of line:
scroller.scrollList(ListView.class, 0, Scroller.DOWN, null);

Modifying the code to:
scroller.scrollList(ListView.class, index, Scroller.DOWN, null);

Fixes the issue

Original issue reported on code.google.com by ebr...@google.com on 25 Jun 2011 at 11:59

GoogleCodeExporter commented 9 years ago
Thanks for this. It will be fixed in the next version.

Original comment by renasr...@gmail.com on 26 Jun 2011 at 8:21

GoogleCodeExporter commented 9 years ago
This has been corrected in Robotium 2.4.

Original comment by renasr...@gmail.com on 13 Jul 2011 at 5:29