So strange! Why the list size is 2?

27 views
Skip to first unread message

Xie Xiao

unread,
Apr 20, 2016, 12:15:09 AM4/20/16
to Robotium Developers
Here is the situation.
I got UI like this. 
(1)LinearLayout     
    (0)LinearLayout      --parent 
          (0)LinearLayout  --son1
                (0)LinearLayout
                    (0)LinearLayout
                       (0)TextView
                    (1)ImageView
                    (2)View
                    (3)EditText
          (1)LinearLayout
                ...
          (2)LinearLayout   --son3
               ...
          (3)LinearLayout
          (4)LinearLayout
          (5)LinearLayout

I have located the parent.And I want get the editText which is included in son1.
So I use this. List<EditText> list = solo.getCurrentViews(EditText.class,parent.getChildAt(0));
EditText et = list.get(0);
But it doesn't work. the size of List is 2. Why?  I have no idea with that. After some try,
I found that one editText is included by son3,another editText is included by son1.
Does anyone encounter this situation? Please help me out

Renas

unread,
Apr 20, 2016, 10:36:03 AM4/20/16
to robotium-...@googlegroups.com
Use uiautomatorviewer to find the resource ID of the EditText. Then you can use solo.getView(). 

--
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.
Visit this group at https://groups.google.com/group/robotium-developers.
For more options, visit https://groups.google.com/d/optout.

Xie Xiao

unread,
Apr 20, 2016, 10:36:01 PM4/20/16
to Robotium Developers
But there is no resource ID of the EditText.

在 2016年4月20日星期三 UTC+8下午10:36:03,Renas Reda写道:
To unsubscribe from this group and stop receiving emails from it, send an email to robotium-developers+unsub...@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages