It's part fo the text in the element rather than part of the html itself, from what I can see. Though it may just be misplaced code that has got injected into the page.I think the OP needs to talk to the developers/designer about what this is for rather than just automating it.Though I can't see why a simple XPath of something like: //*[.=''::before'] ...... shouldn't work.
::after is a pseudo element which allows you to insert content onto a page from CSS (without it needing to be in the HTML). While the end result is not actually in the DOM, it appears on the page as if it is, and would essentially be like this""::afteris a pseudo element which allows you to insert content onto a page from CSS (without it needing to be in the HTML). While the end result is not actually in the DOM, it appears on the page as if it is, and would essentiallly be like this"
Actions action = new Actions(driver);action.moveToElement(driver.findElement(By.cssSelector("button[id$='save-button']"))).build().perform();WebElement switchLabel = driver.findElement(By.xpath("'your xpath/id/Css/etc here"));
String pseudo = ((JavascriptExecutor)driver)
.executeScript("return window.getComputedStyle(arguments[0], ':before').getPropertyValue('content');",switchLabel).toString();
System.out.println(pseudo);
--
You received this message because you are subscribed to the Google Groups "Selenium Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to selenium-user...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/selenium-users/86a66d92-c5c7-49fe-b78a-6b747b0b7220%40googlegroups.com.