Xpath newbie here.
My target element has only one unique feature, it contains ::after. I can't figure out how to use this feature in an xpath expression, googling didn't help much.
code looks smth like this, there are no classes in my target element or elements that contain it that i can use. (actually there are, but they are auto-generated and developers advice against using them, as they may change any time) I want the first div in this code, that contains everything else.
<div>
<div>some text here</div>
<div>here as well</div>
::after
</div>
I am consiedering an option of searching by text, but it's not really what i want because text is what i'm going to be asserting in my test, so it sounds wrong to serch for text and assert the text again.
It's impossible with XPath, at least with XPath version 1.0 supported by Selenium.
With selenium you can access pseudo elements ::before
and ::after
with CSS Selectors only.
See here and here for more detailed explanations