Skip to main content

So I have a table that I need to select each invoice download one at a time
As you can see, there are also page numbers that I have to click through to continue through the table.

I have already looped the pages, and I have also created a variable that will tell me how many rows are in that table, and set my loop-within-a-loop to iterate as many times as there are rows on that page. So all of that is ready to go. The part I’m not sure how to do is I need to click each download button one at a time, and then read the contents of the invoice, THEN put that into a variable. I know how to have read the invoices, and put those contents into a variable, what I’m wondering is how to essentially tell the loop to click the same amount of times as there are rows, but click the different download each time. And keep the loop from continuing to the next button until the page has been read and put into a variable.

Thoughts?

In your Recorder: Capture actions for the buttons, take a look at the DOM Xpath values. Find the pattern. Something like:

First button:  //trr2]/tdd4]/a/img

Second button:   //tr/3]/td/4]/a/img

etc.

Do you see how the tr value increments? You can replace that value with a number variable (cast as a string) to go through all available links.

Follow the link, get your data, send a BACK button to the browser, get the next link, etc.


To click each download button in a table and extract invoice data, you can use a dynamic Xpath with a variable for the row number:

  1. Identify the Pattern: Capture the Xpath for the first button, and then second button. Then find the value in both Xpaths that increments for each button. Also validate it by inspect element in browser.

  2. Loop Through Rows: Set up a loop that for the number of rows and use that current variable in the Xpath by replacing it with the incrementing value. So, then the bot clicks each button based on the current row number.


@Aaron.Gleason ​@Om Keskar 

Yeah - would do the same approach!

 

Cheers

Marc


Reply