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

264
Visualizações
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 Respostas
Responde à pergunta

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 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