How to bypass previous pages to the last using Selenium

182 views Asked by At

I have this scenario, there are 5 pages with the same URL, each with inputs HTML elements. Let's say the URL is https://abcnyweb.com/pages. The problem with navigation is that all the pages shared this one and only URL, so if I want to move to the fifth page without landing on the first page, it's not possible. I have to start filling the forms all over again from the first one.

There are buttons that leads from the previous to the next page, and there are more than 15 elements in each page to be filled. If I don't fill the inputs the validation wouldn't allow move to the next page.

Is there a way I can move to the fifth page without having to click through the 4s before it?

World headless Selenium script help to achieve this?

The form on each page saves when I click the submit button.

1

There are 1 answers

1
Bertrand Nau On

It depends on how the navigation is implemented on your application.

If it's client-side rendered (handled by javascript), you can call the appropriated js function.

If it's server-side rendered (retrieved with HTTP), check the parameters of the request. If some of them stand for the page number, call the request with the good parameters. If it's not the case, i'm afraid you won't have any alternative.