solo.getCurrentViews(TextView.class) returns also other classes

685 views
Skip to first unread message

Vladimir Marek

unread,
Apr 5, 2013, 6:57:52 AM4/5/13
to robotium-...@googlegroups.com
Hello,

I have a question about the solo.getCurrentViews method.
Code example:

ArrayList<TextView> textViews = solo.getCurrentViews(TextView.class);

then when checking with debugger the textViews contains also objects
like ActionMenuItemView, Button, EditText or Alertindicator.
I would expect it would contain only TextView objects.

I'm using robotium 4.0 and testing APK file directly on Samsung Galaxy
SIII [Android 4.1.2].

Any idea what I'm doing wrong?

Thanks,
Vladimir

Renas

unread,
Apr 5, 2013, 7:27:43 AM4/5/13
to robotium-...@googlegroups.com
Hi,

All of those classes extend from TextView and that is why they are returned. You can read more about TextView here:


/Renas




--
You received this message because you are subscribed to the Google Groups "Robotium Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email to robotium-developers+unsub...@googlegroups.com.
To post to this group, send email to robotium-developers@googlegroups.com.
Visit this group at http://groups.google.com/group/robotium-developers?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.



Vladimir Marek

unread,
Apr 8, 2013, 6:50:27 AM4/8/13
to robotium-...@googlegroups.com
This does not work because as Renas mentioned all of them extend TextView.

On 04/08/2013 11:56 AM, Gennadiy Rabkin wrote:
save result in a data structure and then inspect all elements using "instanceof" construction

О©╫О©╫О©╫О©╫О©╫О©╫О©╫, 5 О©╫О©╫О©╫О©╫О©╫О©╫ 2013О©╫О©╫., 13:57:52 UTC+3 О©╫О©╫О©╫О©╫О©╫О©╫О©╫О©╫О©╫О©╫О©╫О©╫ Vladimir О©╫О©╫О©╫О©╫О©╫О©╫О©╫:
О©╫ О©╫Vladimir

--
You received this message because you are subscribed to the Google Groups "Robotium Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email to robotium-develo...@googlegroups.com.
To post to this group, send email to robotium-...@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages