Re: Can't see icons on image bar.

62 views
Skip to first unread message

naveed

unread,
Oct 18, 2012, 2:11:02 AM10/18/12
to robotium-...@googlegroups.com
You should be able to get id through hierarchyviewer

On Thursday, October 18, 2012 7:04:37 AM UTC+5, Karen Liu wrote:
Hi, 

I've been having trouble finding the icons using robotium. I could find some icons using clickonimage, clickonmenuitem, clickonimagebutton, etc.

I've even tried to loop through with views.

I've read through forms and this command was suggested:
getInstrumentation().invokeMenuActionSync(getActivity(), R.id.button1, 0);

but I'm not sure how to get the R.id of the menu item.... 

I've attached an image, circling in red the icons i can't read. I would read all other menu items, ( the outer icons)

any suggestions?

note: i'm using a tablet, 4.1.1

Thanks in advance!

Sunil Alapati

unread,
Oct 19, 2012, 2:16:30 AM10/19/12
to robotium-...@googlegroups.com
Use hierarchyviewer tool to view to get id of the particular item. also it helps you to know what type of widget it is?

On Thu, Oct 18, 2012 at 7:34 AM, Karen Liu <kal...@gmail.com> wrote:
Hi, 

I've been having trouble finding the icons using robotium. I could find some icons using clickonimage, clickonmenuitem, clickonimagebutton, etc.

I've even tried to loop through with views.

I've read through forms and this command was suggested:
getInstrumentation().invokeMenuActionSync(getActivity(), R.id.button1, 0);

but I'm not sure how to get the R.id of the menu item.... 

I've attached an image, circling in red the icons i can't read. I would read all other menu items, ( the outer icons)

any suggestions?

note: i'm using a tablet, 4.1.1

Thanks in advance!

--
You received this message because you are subscribed to the Google Groups "Robotium Developers" group.
To view this discussion on the web visit https://groups.google.com/d/msg/robotium-developers/-/F3f58naLGBgJ.
To post to this group, send email to robotium-...@googlegroups.com.
To unsubscribe from this group, send email to robotium-develo...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/robotium-developers?hl=en.

Sergey Tolkachov

unread,
Oct 19, 2012, 3:02:43 AM10/19/12
to robotium-...@googlegroups.com
Is this activity part of your application ?
If it's part of native video application you can't interact with it because of instrumentation architecture.

On Friday, October 19, 2012 2:59:01 AM UTC+2, Karen Liu wrote:
I've gotten the id of the icons. THANKS ALOT for that input!!

but now, I'm not able to find the R.id.... how do i import something?

im putting this: getInstrumentation().invokeMenuActionSync(getActivity(), R.id.camera_menu_upload, 0);

and it's returning camera_menu_upload cannot be resolved or is not a field.

Sergey Tolkachov

unread,
Oct 21, 2012, 2:07:43 AM10/21/12
to robotium-...@googlegroups.com
Look into R.java. If you can find there your id you can use it.
The fact that you can see id and the view in hierarchy is not sufficient. You will there any view and id (it just work this way)
Reply all
Reply to author
Forward
0 new messages