How to use a web element attribute with dynamic id

I have a set of web elements with attribute ‘id’ and they change by only the last character of the value. Eg, element 1 id=‘abc1’ element 2 id=‘abc2’ etc… There are no other unique attributes to capture. The solution that I came up was to set a counter and identify each element like this:

<webctrl id=‘abc’+{{Counter}}+’/>

But unfortunately I am not able to validate the element, and I am unsure if I need to use any escape sequence here.

Hi,

The above seems wrong expression. Can you try to highlight string which is dynamic, then right click., as the following document.

And we can validate the dynamic selector using default value of the variable.

Regards,

1 Like