# \<text\> tag in xpath inside \<g\> tag. How to create a xpath?

**URL:** <https://forum.katalon.com/t/text-tag-in-xpath-inside-g-tag-how-to-create-a-xpath/80548>\
**Category:** Web Testing\
**Tags:** katalon-studio\
**Created:** [November 11, 2022, 11:03am UTC](https://forum.katalon.com/t/text-tag-in-xpath-inside-g-tag-how-to-create-a-xpath/80548 "2022-11-11T11:03:33Z")\
**Posts on this page:** 1\
**Showing post:** 5

<div class="post-metadata">

**Author:** ![kazurayam](https://dub1.discourse-cdn.com/katalon/user_avatar/forum.katalon.com/kazurayam/32/333_2.png) [@kazurayam](https://forum.katalon.com/u/kazurayam)\
**Post date:** [November 11, 2022, 12:05pm UTC](https://forum.katalon.com/t/text-tag-in-xpath-inside-g-tag-how-to-create-a-xpath/80548/5 "2022-11-11T12:05:51Z")

</div>

Ah, Scalable Vector Graphics embeded in HTML!

Then you need to write far complex XPath.

For example

```auto
//*[local-name()='svg']//*[local-name()='g' and @id='MACHINE-ID']/*[local-name()='text' and position()=1]

```

For more info, Please have a look at the following post:

> [@Katalon CSS/Xpath not working with SVG charts](http://forum.katalon.com/t/katalon-css-xpath-not-working-with-svg-charts/9155/21):
>
> I have made a demo that runs successful. See the test case TC1 where you will find a XPath expression I propose.

---

_[View the full topic](https://forum.katalon.com/t/text-tag-in-xpath-inside-g-tag-how-to-create-a-xpath/80548)._
