I have an SVG
object with a few rectangle elements. Using geckodriver
, I am trying to click on one of the main SVG
object. However wit
Try following XPath
and let me know if problem still persist:
//div[@id="avg_score_chart"]//*[name()="svg"]
For <g>
elements:
//div[@id="avg_score_chart"]//*[name()="svg"]/*[name()="g"]
Update
Finally, this should be nearly the best option:
//div[@class="portlet light boxshadow"][contains(.,"Store Wise Performance")]/div//div[@class="amcharts-chart-div"]/*[name()="svg"]//*[name()="g"]/*[name()="path" and @fill="rgb(242,244,28)"]
how about:
//div[@id='avg_score_chart']//*[local-name()='svg']/*[*[local-name()='path']]
where you find any element with a 'path' element inside an 'svg' element inside a 'div' element with id 'avg_score_chart'.
Edit: placed the xpath in a code block