Asked
Active
Viewed 41 times
2 Answers
0
I would try something like this: //g[@id="box_0"]

Lukas Hajda
- 136
- 4
-
Thank you so much for the response. Already tried it but didn't really work. I somehow solved it but I'm not pretty sure if this is the good way to do it. I mean, it's a good practice etc. I did it this way: //*[contains(@id, 'box_0')]"); I'm new to automation so I still have to learn things. – ccnc May 30 '21 at 08:32
0
To grab SVG elements using XPath
Please go through : How to use xPath in Selenium WebDriver to grab SVG elements?
In Your case any of the below should work:
//*[contains(@id,'box_0')]
//*[name()='g' and contains(@id,'box_0')]

Koustubh Madkaikar
- 125
- 6