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

171
Vistas
While doing selenium, how to do enter key action, on a search bar which has no search button

I've been trying to test an ecommerce site after I close the initial popup no elements is captured by

bd.findElement(By.xpath("/html/body/div[5]/div[2]/div[1]/div[4]/div[3]/div/span")).click();

So, I have been using

JavascriptExecutor js = (JavascriptExecutor)bd;
js.executeScript("arguments[0].click();", element);

And after a while I got stuck at a place where I have to do the enter key action. I have been trying various keys for this and none of them seems to work. So, I either need a code for using the enter button event on the search bar using JavascriptExecutor or a solution where I can fetch elements using findElement.

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

0

To enter the text within the search field you can use the following solution:

js.executeScript("arguments[0].value = 'valueToEnter';", webelement);
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