Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

360
Vistas
How to validate pagination counter text changes with each page?

A very much beginner to JS and coding in general, so my apologies if this is too elementary of a question to ask.

Goal: On a webpage, I am going through a page that has a maximum of five pages total. There is a pagination counter at the bottom that reads "Page x of 5", with the "x" displaying the page the user is on. I simply have to navigate to the "next" page and verify that the pagination text updates to the correct counter text (Page x of 5).

The code is as follows:

let paginationValues = function(){
                var nextPageBtn = false
            do {
                    nextBtnPagination = driver.exists('ul.pagination-skipToNext')
                    if (nextBtnPagination) {
                        //do stuff
                } 
                    } while (nextPageBtn) 

The xpath points to a text value with the pagination counter text using Selenium WebDriver.

So basically I have to click the "next page" button if it exists, which I have done. However, I need to validate that the pagination text responds accordingly by making sure the user is navigated to "Page 2 of 5", "Page 3 of 5" and so on.

Please advise.

about 4 years ago · Juan Pablo Isaza
1 Respuestas
Responde la pregunta

0

If all you need is to display the page number that user navigated to, then why don't you just use global variable and increment/decrement its value based on user navigation actions. and display its value, I think this would be much better then trying with selenium webdriver which extract the value through DOM.

about 4 years ago · Juan Pablo Isaza Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda