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

162
Vistas
How can I get the search button textusing PlayWright end to end testing tool

How can I get the search button text in PlayWright end to end testing tool. I have tried below and getting page.innerText(selector, options) but getting undefined. Can someone please advise why the innerText method is not working here.

//homePage.js

const { expect } = require('@playwright/test');

exports.HomePage = class HomePage {
    constructor(page) {
        this.page = page;
        this.getSearchButton = page.innerText(.RoundButton__root .RoundButton__root--blue');
      }

      async goto() {
        await this.page.goto('https://www.localsearch.com.au/');
      }
      
      async getSearchButtonText() {
        await this.getSearchButton ;
      }
      
}

//home.js

const { test, expect } = require('@playwright/test');
const { HomePage } = require('../pom/homePage');

    test('Verify Search button text', async ({ page }) => {
      const homePage = new HomePage(page);
      await homePage.goto();
      const text = await homePage.getSearchButtonText();
      console.log("Search text::"+text);
     
    });
about 4 years ago · Juan Pablo Isaza
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