Skip to main content
Question

DomXPath

  • February 4, 2025
  • 7 replies
  • 181 views

Forum|alt.badge.img+4

Can we give a wild card(*) in dynamic DomXPath? Instead of using counter.

Ex: //table/tbody[1]/tr[*]/td[3]/a[1]

7 replies

Aaron.Gleason
Automation Anywhere Team
Forum|alt.badge.img+14
  • Automation Anywhere Team
  • February 4, 2025

No, unfortunately you cannot. If you could, you would be specifying multiple objects, rather than just one as the Recorder: Capture package needs.

Your best bet is to use a counter. It doesn’t take that much extra effort and will allow you to point to a single object as expected.


Forum|alt.badge.img+4
  • Author
  • February 4, 2025

Thank you Aaron. Can we capture an object with out using DomXPath and using inner html and html title alone?


Forum|alt.badge.img+4
  • Author
  • February 4, 2025

If using counter, should I get the table into a data table and capture number of rows? And loop through the rows? Based  on what value will the loop end?


Aaron.Gleason
Automation Anywhere Team
Forum|alt.badge.img+14
  • Automation Anywhere Team
  • February 4, 2025

Thank you Aaron. Can we capture an object with out using DomXPath and using inner html and html title alone?

Usually, yes. Like other properties, DOMXPath can be turned on or off. It just takes a bit of experimentation to see what the best solution is.

If using counter, should I get the table into a data table and capture number of rows? And loop through the rows? Based  on what value will the loop end?

Capturing the HTML table into a data table is usually a good idea. You can then loop through the data table. No need for a counter or to find out the number of rows. Each row is stored in a Record variable (don’t use “multiple variables” for an HTML table) and will include the header row, unless you use Data Table: Delete Row (index 0) to remove the header.


Forum|alt.badge.img+4
  • Author
  • February 4, 2025

I am trying to export a search query to excel depending on the title. So counter is best to go to the row I guess, but my loop is not incrementing as it is supposed to.


Forum|alt.badge.img+4
  • Author
  • February 4, 2025

Thank you for all your inputs Aaron 


madhu subbegowda
Most Valuable Pathfinder
Forum|alt.badge.img+12
  • Most Valuable Pathfinder
  • February 6, 2025

You may use counter in a loop, this should help you. Using wildcard might not working as expected.