Hi @Eleeenggg
You can consider below approach:
- use a do while where inside do block, you will use element exists to first check if element with id exists. While condition would be when next element doesn’t exist
- before do while , define a counter variable with value, inside do while, use it in element selector. Define id = ‘prefcode{{counter}}’
- first time do while loop runs, prefcode1 element will be checked if exists, then do your steps with the text box
- increment the counter by 1
- element exists condition under while will be with this new counter value. So basically we are checking if next text box exists, if yes, then only perform next steps else exit the loop
Regards
Sonali