xiaofans / robotium

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

Add more getXXX(int resID) & clickOnXXX(int resID) methods #363

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
It would be nice if we have more of those getXXX() & clickOnXXX() methods by 
Resource ID as parameter so that it's easier for us to pin-point exactly which 
visual controls we are referencing to.  Especially when now considering 
Fragments and I may have multiple Fragments that contain multiple ListView and 
now clickInList() don't quite work for the 2nd ListView.  I have to developed 
something to work around that (searchText(), scrollUp or scrollDown to find the 
item and then click()).

Robotium is just a great addition on the Instrumentation.  Many thanks for all 
of your great effort.

Original issue reported on code.google.com by courag...@gmail.com on 6 Dec 2012 at 12:11

GoogleCodeExporter commented 9 years ago
What happens when you try to use clickInList() for the 2nd ListView?

Original comment by renasr...@gmail.com on 6 Dec 2012 at 6:44

GoogleCodeExporter commented 9 years ago
This would indeed be a nice addition. Currently, we have wrappers like

    public void clickOnStringId(int stringId) {
        solo.clickOnText(Pattern.quote(solo.getString(stringId)));
    }

As clickOnText() accepts a regex we first need to quote the resource string to 
get a literal match. It would be nice to have this directly in Robotium.

Original comment by sschuberth on 20 Dec 2012 at 12:16

GoogleCodeExporter commented 9 years ago
getView works with all views. There is no need to know what kind of view it is. 

Just do something like View view = solo.getView(R.id.x)
solo.clickOnView(view);

Original comment by renasr...@gmail.com on 2 Jan 2013 at 12:23

GoogleCodeExporter commented 9 years ago
Granted, for visual controls this feature request probably does not make much 
sense. But what about my comment regarding string resources?

Original comment by sschuberth on 2 Jan 2013 at 12:41

GoogleCodeExporter commented 9 years ago
I like the idea. This will be included in the next release.

Original comment by renasr...@gmail.com on 7 Jan 2013 at 7:50

GoogleCodeExporter commented 9 years ago

Original comment by renasr...@gmail.com on 29 May 2013 at 12:29