Accessing/Clicking on items in GridView

571 views
Skip to first unread message

Lindsey

unread,
Apr 12, 2011, 1:18:53 PM4/12/11
to Robotium Developers
Hi,

Let me preface this by saying that I am really *really* new to
Robotium/Android/Java/electricity and all of that, so this may be a
very basic/embarrassingly dumb question. I am trying to write a sample
automated test with Robotium for the android app my company is
developing. I only have access to the apk file, not the source code. I
want to write a very simple test that just runs through accessing the
various available functions on the main page of the app. The items
aren't indexed or available by access through name - they're laid out
in grid view. My question is, how do I get the id/location of these
various items so that I can click on them, without having access to
any of the source code? Any help would be appreciated, even if it's
just pointing me to a place where I can read more on this topic.
Thanks in advance!

Yahor Paulavets

unread,
Apr 12, 2011, 2:53:00 PM4/12/11
to robotium-...@googlegroups.com, Lindsey
Hello,

You are welcome to use android_sdk/tooks/./hierarchyviewer.sh for exploring the application's
inner Views hierarchy.

Hierarchy viewer is a very powerful tool. You can write a super complicated automated test
with help of hierarchyviewer in 45 minutes.

Please note: you can not touch a single View in the apk, which is signed with not your certificate.
In other words, your test project must have certificate to sign the test apk same as apk you have.

Best regards,
Yahor


--
You received this message because you are subscribed to the Google Groups "Robotium Developers" group.
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.


Ann

unread,
Apr 12, 2011, 8:21:31 PM4/12/11
to Robotium Developers
Yahor,

My test applications have res folder copied from the application under
test. Don't you require the res folder in your test application?
Wondering if I am creating test apps the wrong way. Since when the
application (under test) makes changes to layouts, my test app also
requires re-build with latest copy of res folder.

Shed some light please, thanks

Ann

On Apr 12, 2:53 pm, Yahor Paulavets <ypaulav...@agilefusion.com>
wrote:
> >http://groups.google.com/group/robotium-developers?hl=en.- Hide quoted text -
>
> - Show quoted text -

Yahor Paulavets

unread,
Apr 13, 2011, 3:41:08 AM4/13/11
to robotium-...@googlegroups.com, Ann
Hello Ann,

You can find a lot of really helpful information here: http://developer.android.com/guide/topics/testing/testing_android.html

I think res folder is optional, it is present and has layour/drawable/values empty folder, since your test application is depend
on testing application, it is using testing application's res folder to get R class and whatever info it needs. So your test
should have empty res folders as well as gen folders. Because test apk is using all resources from main apk.

Test is not allowed to change layout. It is not logical.

Your test, when you run it, will trigger main app and test app rebuilding, otherwise you will not see any changes in your test
logic, because it will be not deployed on device.

Please let me know if you have any questions.

Best regards,
Robotium fan, Yahor
Reply all
Reply to author
Forward
0 new messages