Facing problem in updating value of different elements of same HTML structure

When I am trying to update the different elements of the same HTML structure, then it is detecting the 2nd element but it’s not updating it, it just moves again to the 1st element, and update the 1st element only, this is happing because the key-value (Object name) is the same for both the element.

Object key: Webapp DEV/input_IGeneralities_form-control



Please suggest the solution on how to update value of different elements that belongs to the same HTML structure.

We are going to need to see more information.

Read this post and follow the advice:


Here I am trying to explain the problem,

I have run this script:

Here you can see 3 different elements objects are the same when I run this script it’s always updating the 1st one element’s value, and complete all script successfully, it’s not breaking anywhere.
Please look the fields are given screenshot here the 1st field always updating by script 2nd and 3rd field value not updated:
Here I have attached the HTML screenshot, maybe it helps you to find my problem:

Of course it will update just the first one. Doing something with the TestObject will always refer to the first one found. You either need to update your xpath to fetch the first/second/third/etc or work around it with WebElements, but that’s a lot more work.

Thank you so much for your response, it’s work for me alot.