Issue
I was trying to find a way to click on an element from a class/ID that has the clickable attribute TRUE but has no other attribute to be differentiated from the others.
The said element has another class/ID with the attribute text but has clickable is FALSE.
How can I do this using Selenium with Python?
How can I use 2 different classes to iterate based on the attribute text?
<Class/ID A (android.widget.RelativeLayout)/(com.project.ProjectName:id/itemContainer);
clickable: true; text: none;
<Class/ID B (android.widget.TextView)/(com.project.ProjectName:id/title);
clickable: false; text: BlaBlaBla>>
Can anyone help me with that? Thanks in advance.
Solution
Use Ancestors
xpath:
//*[@text='BlaBlaBla']//ancestor::*[contains(@resource-id, 'itemContainer')]
Answered By - frianH
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.