How to get all the TextViews contained in a ListView object without using ClickOnList?

64 views
Skip to first unread message

Shivang Seth

unread,
Aug 11, 2011, 1:03:14 PM8/11/11
to Robotium Developers
Hi I have a ListView object used to display the name of employees in
my application. On clicking on an employee name app launches another
activity. The ListView contains TextView objects corresponding to
each employee. I want to click on each employee's name in the
ListView . How could I do it? I don't want such a case to happen that
I have to necessarily click on the name of first employee shown. Or
if I am sounding vague could anyone tell me how to click on the Name
of employees displayed in my application at any random index. Ex for
10 employees I want to start by clicking on 4th employee(4th is not
fixed...it can well be 6) then the one at 8th position then 2nd and
so on.

garry

unread,
Aug 11, 2011, 1:34:19 PM8/11/11
to Robotium Developers
Use solo.clickOnText("employee_name")

Yahor Paulavets

unread,
Aug 11, 2011, 5:05:56 PM8/11/11
to robotium-...@googlegroups.com
Hi,

Tell to devs to add some tag fore every employee's name TextView,
use solo.getCurrentTextViews(), iterate through them, and if some of
them has tv.getTag().toString().equals("name") -> solo.clickOnView(tv); sleep;

Best regards,
Yahor

Use solo.clickOnText("employee_name")
--
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.


Shivang Seth

unread,
Aug 12, 2011, 1:56:19 AM8/12/11
to Robotium Developers
Thanks Garry. Thanks Yahor :)

Yahor Paulavets

unread,
Aug 12, 2011, 3:06:09 AM8/12/11
to robotium-...@googlegroups.com
You are always very welcome! :)

Best regards,
Yahor

On Fri, Aug 12, 2011 at 8:56 AM, Shivang Seth <shi...@rideinsync.com> wrote:
Thanks Garry. Thanks Yahor :)
Reply all
Reply to author
Forward
0 new messages