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

205
Visualizações
How to find an element in Cypress on a specific line

I'm looking for a way to use Cypress to identify the trash can icon, provided you have to select a line with specific text, in this case Cypress. The solution I tried is as follows:

var btndelete = cy.get('#SCGrouGrid').find('.dx-data-row').contains('UICypress').then("td").eq(5).find(".dx-icon-trash");

Here is HTML of the web Here is UI

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

0

You can do something like this:

cy.contains('td[role="gridcell"]', 'Cypress')
  .parent('tr.dx-data-row')
  .within(() => {
    cy.get('.dx-icon-trash').click()
  })

First, it will search for the td element where the text Cypress is. Then using parent, we go to the tr or row of the element where our text is. Them using within we are making sure the command we are running is scoped to that particular row only. Then we are clicking on the Trash icon inside within.

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