In my Java Selenium automation project I have to know about some web elements if they are containing pseudo elements or not.
I already saw this question and the answer there simply doesn't work.
This looks better, however in my situation I already have a web element and I need to get it's content while in that answer the JavaScript receives a locator.
I absolutely do not familiar with JavaScript that's why I'm asking:
So, given a Selenium WebElement element. How can I know does this element contain pseudo element or not?
On a screenshot there is an element with red dot - the ::after
pseudo element while other elements doesn't have such red dot.
This is what I got from the dev tools as outerHTML for element containing the after
pseudo element. i even can't see it there and it is just similar to other elements there who doesn't contain pseudo elements.
<div workspaceid="49426bdc-59fe-44ec-82ea-8f567407c04f" data-test-id="9B1qjz0kWcfO" class="list-item ListItem__ListItemComponent-bsdtqz-0 dgogUS RoleItem-sc-1n184cw-0 jyfJwu role-item"><p class="text-component Texts__GenericText-sc-1dju4ks-0 czkGYX name p">9B1qjz0kWcfO </p></div>