Re: Print Activity and page details

45 views
Skip to first unread message

naveed

unread,
May 15, 2013, 2:32:45 AM5/15/13
to robotium-...@googlegroups.com
Yap you can get these values through a few lines of code. 

-Naveed

On Wednesday, May 15, 2013 10:35:56 AM UTC+5, Ravi Devatagal wrote:
Dear Team,

As identifying the id values and activity thriugh hiearchy view is one method. But is there any alternate way to print all these details as soon as the page loads (Activity, id values, images, buttons)?

Please kindly help me!

naveed

unread,
May 15, 2013, 2:55:55 AM5/15/13
to robotium-...@googlegroups.com
here  you go :)

ArrayList<View> allViews = solo.getCurrentViews();
Log.i(" ", "Total Views:" +allViews.size());
for(View vView : allViews)
{
Log.i("",  "View : "+vView.toString()+
"View ID: "+vView.getId()+
        " Value:"+vView.getClass().getName().toString()+
        " Visibility:"+vView.getVisibility());

On Wednesday, May 15, 2013 11:46:35 AM UTC+5, Ravi Devatagal wrote:
Thanks Naveed,

Can you coat some actual lines, It will speed up and helpful for me.

naveed

unread,
May 16, 2013, 10:59:02 AM5/16/13
to robotium-...@googlegroups.com
count the button index and click on it using 
solo.clickOnButton(index)

On Thursday, May 16, 2013 12:42:12 PM UTC+5, Sarita Padhy wrote:
Hi Naveed,

I tried your code and took the logs for the shutter button in camera.Below is the log:

 ( 7317): View : com.android.camera.ShutterButton{40cfb550 VFED..C. ......I. 189,29-290,130 #7f0d0007 app:id/shutter_button}View ID: 2131558407 Value:com.android.camera.ShutterButton Visibility:0

I want to click on the shutter button. How can I click on the button?

Regards,
Sarita
Reply all
Reply to author
Forward
0 new messages