Explore Courses Blog Tutorials Interview Questions
0 votes
in DevOps and Agile by (19.7k points)

I have the following HTML:

<div id="imageholder>


        <g> <image href='blah.gif'> </g>



And I cannot seem to locate the svg with selenium IDE on firefox at all. I have tried:





None of them can locate my svg element. Sometimes I get the error:

error = TypeError: e.scrollIntoView is not a function

I'm using this as a means to use the locator in JUnit 4 testing if that helps.

1 Answer

0 votes
by (62.9k points)

The question is concerning XPath, however, if you will use CSS Selectors, that might be a lot of decipherable, like thus (Java)

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

If you are interested to learn Selenium on a much deeper level and want to become a professional in the testing domain, check out Intellipaat’s Selenium automation online training

Welcome to Intellipaat Community. Get your technical queries answered by top developers!

30.4k questions

32.5k answers


108k users

Browse Categories