RE: Issue with SVG Element

I am having a button inside SVG element and xpath keeps on saying not found, how to click  the perticular path with selenium webdriver Kindly Help as i tried with various things like using uri by descendants::* it selects all the below elements but there are lot of elements in it so it is highly impossible to search from the hay of elements. Is there any way to select and click element through javascriptExecutor ?

Mrityunjay Default Asked on September 19, 2014 in Selenium WebDriver.
Add Comment
2 Answers

Using java script

WebElement mapObject = driver.findElement(By.xpath(“//*[name()=’svg’]/*[name()=’rect’]”));
((JavascriptExecutor) driver).executeScript(“arguments[0].click();”, mapObject);

Thanks,
Vishal

Doctor Answered on September 19, 2014.
Add Comment

Your Answer

By posting your answer, you agree to the privacy policy and terms of service.