How to Located a Dynamic ID?

Hello all,

I’m currently trying to grab the text of an input field, and store it in a variable so I can compare it to a csv. That is easy in and of itself.

The problem is that the id that is associated with the input field has a randomly generated string appended to it every time its generated. So I can’t actually locate that field to store the text from it.

Is there some way I can get this text? Can I grab the parent div and somehow get the value of its child element? Is this a problem which can be solved by OCR?

I’m a bit lost on what to do here.

You have to use another type of xpath that is not dynamic.
Each web element has numerous xpaths, choose one that is most suitable for your case and which is not dynamic.
You can use external tools to detect additional xpaths (search in google shore xpath finder addons) or you can use xpath axes (best solution)