Testing a fast scroll bar

183 views
Skip to first unread message

Jonathan Crissey

unread,
Jun 13, 2013, 4:41:06 PM6/13/13
to robotium-...@googlegroups.com
Hi,

I am about to write up a test case for a fast scroll list, similar to the contact list view on the 4.2.2 OS where there is a scroll bar to the right, and when scrolling up and down an index Letter is displayed to denote where you are in the list.

I know we have the solo.scrollTo and solo.searchText method which do on screen scrolling, though I would like to test scrolling with the scroll as well.  Are there any built in methods that allow this?

thanks in advanced -

Jonathan

Jonathan Crissey

unread,
Jun 13, 2013, 7:06:33 PM6/13/13
to robotium-...@googlegroups.com

       this is my solution using the solo.drag method

        int screenWidth = getActivity().getWindowManager().getDefaultDisplay().getWidth();
        int screenHeight = getActivity().getWindowManager().getDefaultDisplay().getHeight();
        int fromX, toX, fromY, toY = 0;
        fromX = screenWidth-4;
        toX = screenWidth-4;
        fromY = (screenHeight/4);
        toY = (screenHeight - 4);
                
        solo.sleep(1000);
       
        //scroll down a bit to display fast scroll bar
        solo.scrollDown();
        //scroll all the way to the bottom
        solo.drag(fromX, toX, fromY, toY, 40);

naveed

unread,
Jun 14, 2013, 6:28:41 AM6/14/13
to robotium-...@googlegroups.com
Are you sure it will work for different screen sized and resolution devices ?

Jonathan Crissey

unread,
Jun 14, 2013, 11:49:40 AM6/14/13
to robotium-...@googlegroups.com
Good point Naveed, I haven't tried on a different resolution.. A better solution would be to some how grab the id of the fast scroll bar itself.. though since its a native Android feature not sure how I would go about doing this..

I should also clarify this is based on using the index scrolling android design ->

http://developer.android.com/design/building-blocks/scrolling.html


--
You received this message because you are subscribed to a topic in the Google Groups "Robotium Developers" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/robotium-developers/DH61v_J8t3k/unsubscribe.
To unsubscribe from this group and all its topics, send an email to robotium-develo...@googlegroups.com.
To post to this group, send email to robotium-...@googlegroups.com.
Visit this group at http://groups.google.com/group/robotium-developers.
For more options, visit https://groups.google.com/groups/opt_out.
 
 

Reply all
Reply to author
Forward
0 new messages