Re: how to get all views (button, textView....)

114 views
Skip to first unread message

Renas Reda

unread,
Apr 8, 2013, 9:50:08 AM4/8/13
to Robotium Developers
Hi,

You can use getCurrentViews() if you want to get all the views
currently displayed.

Please see the javadoc for more information.

/Renas

On Apr 8, 3:27 pm, i.dellor...@gmail.com wrote:
> Hi everybody,
> I need to get all the views (buttons, textViews, radiobutton....) from a
> view.
> for example, if an app showing in the active "window" buttons, textViews,
> radioButtons... i need to get all of them and after to get every properties
> of them (but for that i think i have a solution).
> i've seen the getViews() method but i can't understand if it is what i need.
> Thank's

Idell

unread,
Nov 2, 2013, 3:39:01 PM11/2/13
to robotium-...@googlegroups.com
Hi, 
i found (in the Robotoium 4.3 API) that: 
solo.getCurrentViews()  Returns an ArrayList of the Views currently displayed in the focused Activity or Dialog. and
solo.getViews() Returns an ArrayList of all the View objects located in the focused Activity or Dialog.
but if i'm not wrong, if for example a have a dialog view, the views behind are not captured, using first and second way, is true? 
There is a way to get all the views, in the focused activity and behind? 

Renas Reda

unread,
Nov 4, 2013, 2:54:48 AM11/4/13
to robotium-...@googlegroups.com
Hi,

That is not possible. The Android platform will only return the views in the focused window.

/Renas
Reply all
Reply to author
Forward
0 new messages