Hi have layout in android app like this
ListView
(0)RelativeLayout
(0)TextView:Tom
(1)TextView:OPEN
(2)TextView:1 [ id :conversations_row_message_count]
(1)RelativeLayout
(0)TextView:Jack
(1)TextView:OPEN
(2)TextView:2nd_place_medal:[ id :conversations_row_message_count]
(2)RelativeLayout
(0)TextView:Jack
(1)TextView:OPEN
I want to get preceding Text Views from the relative layout in which Text View with id " conversations_row_message_count " is present.
Below are the ways I have tried till now but nothing seems working for me
1. â//android.widget.TextView[contains(@resource-id,âconversations_row_message_countâ)]â;
**Resut : ** It gave me all the elements where TextView with id âconversations_row_message_countâ.
2."//android.widget.TextView[contains(@resource-id,âconversations_row_contact_nameâ)]/following-sibling::android.widget.TextView[contains(@resource-id,âconversations_row_message_countâ)]";
**Resut : ** It gave me no element as there are not following element
3."//android.widget.RelativeLayout//android.widget.TextView[contains(@resource-id,âconversations_row_message_countâ)]";
**Resut : ** It gave me all the elements with their but when I tried to print itâs class name attribute it throws error âAn element could not be located on the page using the given search parameters.â
4."//android.widget.TextView[contains(@resource-id,âconversations_row_message_countâ)]/preceding-sibling::TextView";
**Resut : ** Tried to get preceding element but dint get any element.
Please suggest where I am going wrong