I have an object with ID
I have to input some text value for this field. I have gone through the existing discussions on dynamic object IDs and know how to handle till “input_Length_billerDetailSubviewidbillerDetailFormIdbillerDetailDataTableId0”
what should i do with the rest, j_id_jsp_195573338_107pc160j_id_jsp_195573338_109pc16? as this is a random ID. Please suggest.
Can you share an example of the HTML for the element, as well as a few of its parent elements?
please find the following
In the above table, the account number and length field can be defined multiple times. For each entry the field will have a dynamic id. Please let me know if any further details required.
Oh, since it’s within a table, I would forget trying to identify the input by any attribute, and just identify it by it’s location in the table. In the below xpath, you can replace the index within the
<td> elements to match the row/column you are trying to target. I’ve set them to row 1, column 1:
If there are multiple tables on the page, you will instead need to better identify the table you are working with. Otherwise, this approach should work fine.
I have tried to identify the field with x path position as shows below; however it shows 9 elements with the same position while i use object spy.
My guess is that there are a bunch of nested tables here. Can you check the following xpath in object spy?
Now I am able to identify the field using the xpath position;
for each entry, table count need to increase for e.g //td/table/tbody/tr/td/input , //td/table/tbody/tr/td/input etc.
Thanks for the help,