I have an element on the web page that has random generated id eg: id=8726dd92-7bdf-4435-bf75-653859329c06
. Now how do I go about writing the xpath for the same?
There were other attributes like aria-label
and class
but none of them seemed to work. I have tried using most of the available xpath generators to capture that element but no success. Right click -> inspect generated //*[@id="8726dd92-7bdf-4435-bf75-653859329c06"]
which is not unique and keeps changing for every page load
This is the tag available for the element:
<input aria-required="true" aria-label="Name" id="8726dd92-7bdf-4435-bf75-653859329c06" class="rwa-input fixed " maxlength="100">
I want to have a function that can capture the dynamic value during run time and replace the variable on my xpath. Eg: //*[@id='dynamic-id']
.