# Dynamic IDs in Web Recording / Customize Recording Selector Strategy

**URL:** <https://forum.katalon.com/t/dynamic-ids-in-web-recording-customize-recording-selector-strategy/57246>\
**Category:** Feature Request\
**Tags:** feature-request, katalon-studio\
**Created:** [August 6, 2021, 11:16am UTC](https://forum.katalon.com/t/dynamic-ids-in-web-recording-customize-recording-selector-strategy/57246 "2021-08-06T11:16:39Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![peter.hevesi](https://dub1.discourse-cdn.com/katalon/user_avatar/forum.katalon.com/peter.hevesi/32/17756_2.png) [@peter.hevesi](https://forum.katalon.com/u/peter.hevesi)\
**Post date:** [August 6, 2021, 11:16am UTC](https://forum.katalon.com/t/dynamic-ids-in-web-recording-customize-recording-selector-strategy/57246/1 "2021-08-06T11:16:39Z")

</div>

Hi,  
I have a problem using Katalon Studio using Record Web feature. Because my colleagues have to put Dynamic IDs to some elements on our websites. We just can’t get rid of them. So instead of let’s say #loginButton, we have #loginButton\_2546897. In all those cases, where we have to use dynamic IDs, we also have name, which is also unique, but without that number. Now when some of our testers records web page, they can’t just replay it, because they have to switch all element locator with Dynamic IDs to use name instead. It is unnecessary work we have to do.

So my question is: Is there any way I can configure Web Recording feature to work well with DynamicIDs? Is there any way I can customize locator strategy of Web Recording to suite my needs? I am a programmer, so any non-trivial hack to customize that process is not a problem for me 😃🙂

---

<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:** [August 6, 2021, 11:55am UTC](https://forum.katalon.com/t/dynamic-ids-in-web-recording-customize-recording-selector-strategy/57246/2 "2021-08-06T11:55:53Z")

</div>

Let me assume your HTML is like this:

```auto
<html>
<body>
<input id="loginButton_2546897">
</body>
</html>

```

When you use Web Recorder to generate a TestObject to select the input element, Web Recorder will generate a Test object with following locator:

```auto
//input[@id='loginButton_2546897']

```

Next time you visit the page, you may see the dynamic portion of the id changed.

```auto
<html>
<body>
<input id="loginButton_01234567">
</body>
</html>

```

The TestObject will fail to select the input element.

How to mange this case?

Once you have saved the Test Object, _you can manually edit its locator_ as follows:

```auto
//input[starts-with(@id, 'loginButton')]

```

The modified locator will work even when the “dynamic portion” in the id value changes in future.

You should edit generated locators **manually** to customise them to suite your needs.

---

<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:** [August 6, 2021, 12:12pm UTC](https://forum.katalon.com/t/dynamic-ids-in-web-recording-customize-recording-selector-strategy/57246/3 "2021-08-06T12:12:14Z")

</div>

> [@peter.hevesi](#):
>
> Is there any way I can customize locator strategy of Web Recording to suite my needs?

No.

Web Recorder is not as intelligent as you want it to be.

---

<div class="post-metadata">

**Author:** ![peter.hevesi](https://dub1.discourse-cdn.com/katalon/user_avatar/forum.katalon.com/peter.hevesi/32/17756_2.png) [@peter.hevesi](https://forum.katalon.com/u/peter.hevesi)\
**Post date:** [August 6, 2021, 12:17pm UTC](https://forum.katalon.com/t/dynamic-ids-in-web-recording-customize-recording-selector-strategy/57246/4 "2021-08-06T12:17:56Z")

</div>

thank you 🙂 They could actually make it little bit more customizable, I saw different people here, that would like to customize it, so I hope some of devs will see this and they will add support for it.  
It’s sad they didn’t provide more controls for us, programmers, because I would customize exactly the way I want easily, if I had access to it 😃

---

<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:** [August 6, 2021, 2:13pm UTC](https://forum.katalon.com/t/dynamic-ids-in-web-recording-customize-recording-selector-strategy/57246/5 "2021-08-06T14:13:36Z")

</div>

Closed on August 6, 2021, 2:13pm UTC


