RobotiumTech / robotium

Android UI Testing
http://www.robotium.org
Apache License 2.0
2.86k stars 787 forks source link

solo.scrollListToBottom(int index) #540

Closed renas closed 9 years ago

renas commented 9 years ago

From heig...@gmail.com on May 21, 2013 01:58:36

What steps will reproduce the problem? 1. Activity with multiple lists in fragments

  1. solo.scrollListToBottom(solo.getCurrentViews(ListView.class).size) 3. What is the expected output? What do you see instead? I expect the last list to be scrolled to the bottom and then continue with the script, instead it scrolls to the bottom and then the test fails with junit.framework.AssertionFailedError: 3 ListViews are not found! What version of the product are you using? On what operating system? Windows, Android 4.0.1, Robotium 4.1 Please provide any additional information below.

Original issue: http://code.google.com/p/robotium/issues/detail?id=461

renas commented 9 years ago

From renasr...@gmail.com on May 21, 2013 04:30:33

Thanks for reporting this. What is the next step in the test case? Can you please paste the complete test case.

Owner: renasr...@gmail.com

renas commented 9 years ago

From heig...@gmail.com on May 21, 2013 05:34:48

Well I have deleted this testcase already and worked around it. But basically I was just trying out this method to click list items, I tried with different steps after this method and none of them seemed to work.

public void testB_voting() throws Exception { solo.waitForActivity("MainActivity", LONG_TIMEOUT); Log.i(TAG, solo.getCurrentViews(ListView.class).size); //Log confirmed 4 listviews were found solo.scrollListToBottom(3); Thread.sleep(3000); }

renas commented 9 years ago

From renasr...@gmail.com on May 21, 2013 05:40:53

As the scroll was performed the exception was not thrown by scrollListToBottom(). The exception was thrown by a method called later in the test case. Probably all 4 ListViews where not shown when the failing method was called.

renas commented 9 years ago

From heig...@gmail.com on May 21, 2013 05:59:52

That is correct, all the listviews are in different fragments. 1 is in a slidemenu and other 3 are in viewpager.

renas commented 9 years ago

From renasr...@gmail.com on May 21, 2013 06:02:46

I think that was the issue. Let me know if you find anything more on this and I'll open this issue up again.

Status: Invalid