I am using Selenium webdriver with java.
I am trying to find elements in drop down lists, can`t access it by exact id/name/xpath because those are dynamic elements, so I tried to locate it by relative xpath, and it works but not fully, please see image below:
IMAGE ON IMGUR (CANT POST IMAGES YES)
As you can see on top left, there is a drop down overlay with 3 options, ALL/ACTIVE/INACTIVE, now I managed to locate all 3 of them by using relative xpath as shown on image:
//*[@class="cdk-overlay-pane"]//*[@class="mat-option-text"]
But how to now get one element (out of 3 in this case) that got specific text, for example "Active" ? I tried following:
//*[@class="cdk-overlay-pane"]//*[@class="mat-option-text"]//*[contains(text(),'Active')]
But it does not find anything, any help would be welcome!