Searching element by class name in appium (python)

936 views
Skip to first unread message

Akmal Nishanov

unread,
Jun 10, 2014, 9:51:00 AM6/10/14
to appium-...@googlegroups.com
Hi there,

Does anyone now how to manage element selection by class in case when I have several RelativeLayouts in ListView.
I'm able to select random RelativeLayout by using driver.find_element_by_class_name('android.widget.RelativeLayout')

Don't know hot to choose exactly what I need, for example second RelativeLayout.
The elements hierarchy looks like this:


Thanks!

Isaac Murchie

unread,
Jun 10, 2014, 1:44:36 PM6/10/14
to Akmal Nishanov, appium-...@googlegroups.com
Use the plural form and select the second

driver.find_element_by_class_name('android.widget.RelativeLayout')[1]

Or else use XPath or UIAutomator commands to select the particular element.


--
http://appium.io
---
You received this message because you are subscribed to the Google Groups "Appium-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to appium-discus...@googlegroups.com.
Visit this group at http://groups.google.com/group/appium-discuss.
For more options, visit https://groups.google.com/d/optout.

Reply all
Reply to author
Forward
0 new messages