Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

172
Visualizações
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 à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda