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

164
Visualizações
I just want to select the button with the text "Continue" within a website with cypress

When I search for the button by the common method it returns 2 results

cy.get('[data-testid="cc-button__element"] > [data-testid="cc-button__text"]')

screenshot-1

However, when I do the search with cypress's own tool, it does locate it quickly and returns 1 result.

cy.get('.block > [data-testid="cc-button"] > [data-testid="cc-button__element"]')

screenshot-2

I know that this is valid, however, I want to do it by the traditional method so that later if there are changes it does not affect my button search methods.

about 4 years ago · Juan Pablo Isaza
1 Respostas
Responde à pergunta

0

If the text Continue occurs just once in your webpage you can use contains to find it and click it.

cy.contains('Continue').click()
about 4 years ago · Juan Pablo Isaza Relatório
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