Closed GoogleCodeExporter closed 9 years ago
The click methods only click on visible views. I think your issue is due to:
Why do text and button clicks get wrong?
http://code.google.com/p/robotium/wiki/QuestionsAndAnswers
Original comment by renasr...@gmail.com
on 9 Apr 2012 at 9:47
Adding <supports-screens android:anyDensity="true"/> doesn't work for me. In
hierarchyview, it shows 4 child of a frameview for a ViewPager. Even only the
2nd fragment is visible, Robotium will try to click the first fragment.
Original comment by mrlhwlib...@gmail.com
on 9 Apr 2012 at 10:45
Would it be possible for you to send me a sample app that exhibits this problem?
Original comment by renasr...@gmail.com
on 10 Apr 2012 at 6:18
You can download the AnyMemo 9.0 beta 11's apk:
http://code.google.com/p/anymemo/downloads/list
I have removed the problematic tests in the code but you an try
clickOnText("Open");
clickOnText("french-body-parts.db");
The implementation of this activity is here:
http://code.google.com/p/anymemo/source/browse/src/org/liberty/android/fantastis
chmemo/ui/AnyMemo.java
Original comment by mrlhwlib...@gmail.com
on 10 Apr 2012 at 6:25
This works for me:
solo.clickOnText("Open");
solo.clickOnText("french*", 2);
solo.clickOnText("Study");
The issue you are experiencing is because there are two text views:
french-body-parts.db. They both have valid locations and both answer true when
asked textView.isShown(). Therefore Robotium does not know that only the
second one is visible to the user. Therefore I have added the parameter 2 in
clickOnText() so that the second match is clicked.
Original comment by renasr...@gmail.com
on 10 Apr 2012 at 9:10
Ok, I see. ViewPager did make views invisible, instead, it put it outside of
the viewing area.
Actually I figured out the real problem is that Robotium can't scroll down in
ViewPager. Use the same AnyMemo app I linked before try this test on a device
with small screen (You need to scroll down in order to click "About" in "Misc"
tab.
solo.clickOnText("Misc");
solo.clickOnText("About");
The test will fail because Robotium don't know how to scroll down.
BTW, if you want to discuss this in a new ticket, I will open another one.
Original comment by mrlhwlib...@gmail.com
on 10 Apr 2012 at 9:19
Original issue reported on code.google.com by
mrlhwlib...@gmail.com
on 7 Apr 2012 at 5:28