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

111
Vistas
Cypress Finding element by partial element name

I would like to get this element in cypress tests but using only part of string without 'undefined'. How can I do that?

<line-chart-undefined tabindex="0"></line-chart-undefined>

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

0

It can be easily done with XPath.

  1. Install cypress-xpath plugin
  npm i -D cypress-xpath
  1. Then include in your project's cypress/support/index.js
  require('cypress-xpath')
  1. After installation your cy object will have xpath command
  cy.xpath("//*[starts-with(name(), 'line-chart-')]")

It'll find the element that matches the line-chart- tag

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