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

156
Vistas
WebdriverIO - OR logical operator in selector

I am using Webdriver IO in my project. I have the following code:

<div>
   <section id="my-section">
      {oneVariable && <p>enumVal1</p>}
      {someVariable && <p>enumVal2</p>}
      {anotherVariable && <a href="someSite">{anotherVariable}</a>}
   </section>
</div>

Is there an easy way through WebdriverIO, to check whether either of the enums (enumVal1 or enumVal2) exist?

I've tried the following but this doesn't work:

$('#my-section').$('p*=enumVal1, p*=enumVal2').isExisting()

Problem is this selector is not treating these values with the OR operator. Is there an easy way to do this?

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

0

Seems like webdriverIOs element locators don't allow the partial link text selector (*=) with the css OR condition (,). You could achieve this using xpath but it is a little messier.

$('#my-section').$(//p[text()="enumVal1"] | p[text()="enumVal2"]);
 
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