Skip to main content
Solved

Dynamic Website Textbox elements

  • April 25, 2025
  • 3 replies
  • 85 views

Forum|alt.badge.img

Hello,

 

Just want to check any suggestions on what action in automation anywhere that fit in this scenario.

Upon checking the elements of textboxes on the website, the id is incremented like prefcode1, prefcode2, prefcode3, prefcode4, prefcode5, so on and so forth.

 

How I will be able to determine all those textboxes using a loop since it is just incremented and has the same keyword element. And all the input data to the textboxes will get from excel sheet. 

 

Thank you for your time. 

Best answer by Marc Mueller

Hi ​@mariaelena062129,

like this DOMXPath: 

//input[@id='prefcode$numCounter.Number:toString$']

3 replies

Padmakumar
Premier Pathfinder | Tier 7
Forum|alt.badge.img+15
  • Premier Pathfinder | Tier 7
  • April 25, 2025

Hi ​@mariaelena062129 ,

 

I hope the object property which you have mentioned here is the DomX path. If so, it is fairly straightforward. You just have to use a counter variable (initialized as 1) and assign this in the dynamic area of the DomX path within loop. After the necessary action, add an increment for the Counter.

 

Hope it is clear.


Marc Mueller
Most Valuable Pathfinder
Forum|alt.badge.img+17
  • Most Valuable Pathfinder
  • Answer
  • April 25, 2025

Hi ​@mariaelena062129,

like this DOMXPath: 

//input[@id='prefcode$numCounter.Number:toString$']


Forum|alt.badge.img+4
  • Navigator | Tier 3
  • April 28, 2025

Hi,

If the IDs are sequential but you want a smarter approach, you can use the "Find all elements" iusing capture  based on a common attribute like 'starts-with' .This way you can collect all elements in list loop through them directly and map the excel one by one through iteration.

Thanks