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.
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.