Selenium cannot find SVG element in XPath Selenium cannot find SVG element in XPath selenium selenium

Selenium cannot find SVG element in XPath


Try the following XPath expression:

//*[local-name() = 'svg']

(works at least from Chrome/FireBug console, haven't tried with Selenium yet)


The question is about xPath, but if you can use CSS Selectors, that would be more readable, like so (Java).

WebElement image = driver.findElement(By.cssSelector("#imageholder > svg > g > image"));