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

263
Vistas
Xpath element not interractable issue. Selenium,Java

I have been trying to access a search bar and submit the query which doesnot have a SEARCH BUTTON, as I Could enter the search query using javascriptexecutor, I Couldnot do an enter button action as It doesnot have any enter button. so I have went with the following ways and none of them worked. Please consider and correct me.

I have tried to do an enter key action on the search bar. the code is as followed driver.findElement(By.xpath("//*[@id="mobile-header"]/div[3]/input").sendKeys(Keys.RETURN); and WebElement search = bd.findElement(By.xpath("//*[@id=\"mobile-header\"]/div[3]/input")); search.sendKeys(Keys.RETURN);

and `in the following code the value is passed but the enter key is not working JavascriptExecutor jj= (JavascriptExecutor)bd; jj.executeScript("arguments[0].value='mercury'", search); jj.executeScript("arguments[0].value=Keys.Return", search);

none of the seems to work. correct if i have my xpath wrong. thanks

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

0

This should work:

    driver.findElement(By.xpath("//*[@class='st-search-box hidden-mobile-only']//input[@type='text']").sendKeys("headphones);
    ActionChains(driver).sendKeys(Keys.RETURN)

DOM snapshot

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