How To Get Svg Xpath. The SVG object being anything under the SVG element eg. Xpath for svg elements should be like namesvg nameg namerect and fill 919EF92.
It starts with double forward slash. It can search elements anywhere on the webpage means no need to write a long xpath and you can start from the middle of HTML DOM structure. You need to call the path inside the click function.
Refer above image suppose we want to identify path of the elements mentioned in third line so the XPath would be like-namesvglocal-namepath and idlineBC.
Local-name svg and data-iconhome local-name path. Writing the XPath relative to the svg element. Then try the XPath uses path expressions to select nodes or node-sets in an XML document. The approach varies according to the relative element we choose.