# Returning the XPath value of a certain TestObject dynamically

**URL:** <https://forum.katalon.com/t/returning-the-xpath-value-of-a-certain-testobject-dynamically/27539>\
**Category:** Web Testing\
**Tags:** katalon-studio\
**Created:** [June 12, 2019, 7:34am UTC](https://forum.katalon.com/t/returning-the-xpath-value-of-a-certain-testobject-dynamically/27539 "2019-06-12T07:34:54Z")\
**Posts on this page:** 1\
**Showing post:** 3

<div class="post-metadata">

**Author:** ![B\_L](https://dub1.discourse-cdn.com/katalon/user_avatar/forum.katalon.com/b_l/32/976_2.png) [@B\_L](https://forum.katalon.com/u/B_L)\
**Post date:** [June 12, 2019, 12:07pm UTC](https://forum.katalon.com/t/returning-the-xpath-value-of-a-certain-testobject-dynamically/27539/3 "2019-06-12T12:07:40Z")

</div>

this is an example of some dynamic xpaths I worked with someone else on. If this helps:

> [@Match Data from Spreadsheet to Search Results in Table, Click Correct one](http://forum.katalon.com/t/match-data-from-spreadsheet-to-search-results-in-table-click-correct-one/22455/7):
>
> Sorry for the delayed response, been busy slight_smile This helps: //\*[@id=“search\_results\_container”]/div/div/div/div[2]/a[1]/h4/text() With this a few things. First if you go with text for some reason Katalon seems to not like that. Also you will notice the “a” it has “a[1]” meaning the first a. so we remove the 1 and it will look for any a //\*[@id=“search\_results\_container”]/div/div/div/div[2]/a/h4/text() We can then apply the contains like this //\*[@id=“search\_results\_container”]/div…

---

_[View the full topic](https://forum.katalon.com/t/returning-the-xpath-value-of-a-certain-testobject-dynamically/27539)._
