Fast scroll in Robotium

0
0

I have created a test project for my Android project. In my app there is a listview that has a lot of data. I need to scroll this listview up and down using Robotium. I have used the scrollUp() and scrollDown() functions, but it is scrolling too slowly.

I am using Robotium 3.3. Is there any way to make a fast scroll?

  • You must to post comments
0
0
int screenWidth = getActivity().getWindowManager().getDefaultDisplay().getWidth();
int screenHeight = getActivity().getWindowManager().getDefaultDisplay().getHeight();
int fromX, toX, fromY, toY = 0,stepCount=1;
// Scroll Down // Drag Up
fromX
= screenWidth/2;
toX
= screenWidth/2;
fromY
= (screenHeight/2) + (screenHeight/3);
toY
= (screenHeight/2) - (screenHeight/3);
solo
.drag(fromX, toX, fromY, toY, stepCount);

here

[1] stepCount=1; // very fast scroll

[2] stepCount=10; // medium scroll

[3] stepCount=17; // slow scroll

So you adjust ” stepCount ” value according to your scroll required speed.

i hope this will help you for your better scroll list view.
Thanks.

  • You must to post comments
Showing 1 result
Your Answer
Post as a guest by filling out the fields below or if you already have an account.
Name*
E-mail*
Website