# Best way to Locate Element

**URL:** <https://forum.katalon.com/t/best-way-to-locate-element/23723>\
**Category:** Web Testing\
**Tags:** web-testing, katalon-studio\
**Created:** [April 24, 2019, 6:37am UTC](https://forum.katalon.com/t/best-way-to-locate-element/23723 "2019-04-24T06:37:30Z")\
**Posts on this page:** 1\
**Showing post:** 2

<div class="post-metadata">

**Author:** ![Mate\_Mrse](https://dub1.discourse-cdn.com/katalon/user_avatar/forum.katalon.com/mate_mrse/32/345_2.png) [@Mate\_Mrse](https://forum.katalon.com/u/Mate_Mrse)\
**Post date:** [April 24, 2019, 7:04am UTC](https://forum.katalon.com/t/best-way-to-locate-element/23723/2 "2019-04-24T07:04:17Z")

</div>

Short answer: there is no permanent solution. 😣

Improved answer: get better locators. 😄

I presume when you say ID’s are changing, that means that ID’s are generated dynamically. In that case, I suggest trying parametrization. I believe the following articles and discussions could be helpful:

[https://docs.katalon.com/katalon-studio/docs/parameterize-webmobile-test-object-properties.html](https://docs.katalon.com/katalon-studio/docs/parameterize-webmobile-test-object-properties.html)

> [@addProperty('xpath' ...) with String as xpath?](http://forum.katalon.com/t/addproperty-xpath-with-string-as-xpath/13351):
>
> I tried to parameterize my testobjects like it’s described here: [https://docs.katalon.com/display/KD/Manage+Test+Object#ManageTestObject-ParameterizingTestObject](https://docs.katalon.com/display/KD/Manage+Test+Object#ManageTestObject-ParameterizingTestObject "Link: https://docs.katalon.com/display/KD/Manage+Test+Object#ManageTestObject-ParameterizingTestObject") It works fine for to get //\*[@class = attribute] with the code below TestObject to = findTestObject('bm/color/colorcode') to.addProperty('class', ConditionType.EQUALS, attribute, true) However it does not work with xpath for me so far… The xpath I want to get: //\*[@class = ‘P0751’]//h4[contains(text(),‘Alpine white.’)] by this: Te…

> [@How to find xpath for element using another dynamic element](http://forum.katalon.com/t/how-to-find-xpath-for-element-using-another-dynamic-element/18467):
>
> In the below scenario i have an element with dynamic value 1251408 and i have to select the option from the dropdown element towards its left i.e i have to select the user corresponding to element 1251408 only… What needs to be done in this case??? The element with value 1251408 is not clickable though.

[https://docs.katalon.com/katalon-studio/tutorials/data\_driven\_testing.html#what-is-data-driven-testing](https://docs.katalon.com/katalon-studio/tutorials/data_driven_testing.html#what-is-data-driven-testing)

---

_[View the full topic](https://forum.katalon.com/t/best-way-to-locate-element/23723)._
