Я пытаюсь найти элемент, который содержит несколько из них с помощью XPath, напримерXPath с несколькими компонентами
<ListView>
<RelativeLayout>
<TextView id=text1></TextView>
<TextView id=text2></TextView>
<ImageView id=img1></ImageView>
</RelativeLayout>
<RelativeLayout>
<TextView id=text3></TextView>
<TextView id=text4></TextView>
<ImageView id=img2></ImageView>
</RelativeLayout>
</ListView>
Я хотел бы получить только относительное расположение, которое содержит TextView с идентификатором = text1, TextView с ид = text2 и ImageView с идентификатором = img1
Я попробовал этот
//ListView/RelativeLayout/TextView[@resource-id='text1'] |
//ListView/RelativeLayout/TextView[@resource-id='text2'] |
//ListView/RelativeLayout/ImageView[@resource-id='img1']
и это
//ListView/RelativeLayout/TextView[@resource-id='text1'] and
//ListView/RelativeLayout/TextView[@resource-id='text2'] and
//ListView/RelativeLayout/ImageView[@resource-id='img1']
Но никто не работает.
Первый, кажется, выбирает все, что содержит 1-й ИЛИ 2-й ИЛИ 3-й, а не один с 3 в то же время.
Второй не выбирает aything.
Я предполагаю, что я должен сделать что-то вроде
//ListView/RelativeLayout/TextView[@resource-id='text1'] and TextView[@resource-id='text2'] and ImageView[@resource-id='img1']
Но я не знаю, как правильно писать:/
Любая помощь?