How to keep track of the current page when I navigate back?

Good day, everyone!

I hope you’re doing well.

I’m trying to find a solution. The dilemma I’m having at deck is that I’m attempting to automate a scenario where a webpage has thousands of pages, but when I click on a specific item and go to the download page, it doesn’t keep track of the current page, and it always goes back to the very first page, despite the fact that I do it for every item, so I only succeed for the first page.

Please advise.

Hello @Kakooza-Allan-Klaus ,

Is there a way to search the pagenumber? You can use a variable to store the last page number. Then use a while to increase the value of a counter variable. Suppose if it is “i”, set default value as “1”. Then inside while increase the value by 1; i=i+1

This way you can keep a track of the page number.

The increasing of the number I can do it but the challenge is keep tracking of the previous page

check for folowing diffeent options:

  • grab / collect all item / download links and loop later over it for the downloading -so the back button action will be obsolete
  • handle the click item / download within a new window/tab and close it after download
  • memorize the url (retrieved from selector) before item click and use it instead of the back button action
1 Like

Thanks for your quick response @ppr
How do I grab all the items

depending on the webpage element structure. Have a first check on

  • data scraping / extract data approach
  • find children approach

This is the situation I’m in. I’m not scraping data; all I need to do is click the view button, which will take me to a page where I may download a document.
Then I go back to the previous page and repeat the process for the remaining items.
@ppr, your technique is brilliant, but I’m working on incorporating it to see how I can handle it.
But if we can get a one on one, that would be extremely beneficial, Sir.


@Kakooza-Allan-Klaus Try below steps

  • Use Get Attribute activity to get the current page URL

  • Once you click on view button and to navigate back to the same page use Navigate To activity to navigate to the previous page (Output of Get Attribute is the input of Navigate To Activity)


1 Like

Thanks @ushu,
My biggest problem is now I can get the href for the next view button because the numbers aren’t sequential

I’ve an idea of opening a new window for each view click I open a new window but the challenge comes in on what to populate in the URL section because each view click has a different URL

URL Format is application/view/*

The last number that keeps changing isn’t sequentially so am boxing with how I can formulate my URL in open browser activity such that is dynamic

So what I did to solution for that
I used data scraping then I scrapped only the view extracting it’s URL and then I used a for Each and I looped through all of them.

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.