I am trying to use to the elements under a tag.
for example, in the website https://demo.bpmn.io/new I can use Chrome developer tools to retrieve the and elements using one of the :

$x('//*[local-name() = "svg"]')
returns:  <svg width="100%" height="100%"  ...</svg>
$$('svg')
returns: object [svg]
$('svg')
returns: object [svg]

And I found in SQA’s answer for “Cannot get attribute value when using xpath” that I can retrieve the svg elements by addressing the namespace svg as in

//*[starts-with(@id,'highcharts')]/svg:svg/svg:g[6]/svg:g[1]/svg:rect[2]

so I tried

$x('*//svg:svg)
>> returns empty: []

What am I missing here?

Is it possible to investigate the svg with XPath but without using the local-name() function?



Source link https://sqa.stackexchange.com/questions/34437/how-to-investigate-svg--in-dom-with-xpath

LEAVE A REPLY

Please enter your comment!
Please enter your name here