# XPATH with variables

**URL:** <https://forum.katalon.com/t/xpath-with-variables/10440>\
**Category:** Web Testing\
**Tags:** katalon-studio\
**Created:** [April 22, 2018, 2:14pm UTC](https://forum.katalon.com/t/xpath-with-variables/10440 "2018-04-22T14:14:37Z")\
**Posts on this page:** 1\
**Showing post:** 4

<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:** [April 23, 2018, 6:40am UTC](https://forum.katalon.com/t/xpath-with-variables/10440/4 "2018-04-23T06:40:16Z")

</div>

Why not have a look at this: Parameterize a Test Object  
[https://docs.katalon.com/display/KD/Parameterized+a+Test+Object](https://docs.katalon.com/display/KD/Parameterized+a+Test+Object)

You will find an example of a Groovy-String as XPath with a ‘index’ variable.

```auto
"//*[@id="main"]/div/table/tbody/tr[2]/td[${index}]/input"

```

And you can give value to the index variable with 2nd Map argument to findTestObject method call.

```auto
WebUI.check(findTestObject('chk_Title', [('index') : it]))

```

See [https://api-docs.katalon.com/studio/v4.7.0/api/com/kms/katalon/core/testobject/ObjectRepository.html#findTestObject(java.lang.String,%20Map\<Object,%20Object\>)](https://api-docs.katalon.com/studio/v4.7.0/api/com/kms/katalon/core/testobject/ObjectRepository.html#findTestObject(java.lang.String,%20Map%3CObject,%20Object%3E)) for detail

---

_[View the full topic](https://forum.katalon.com/t/xpath-with-variables/10440)._
