Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

258
Views
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 answers
Answer question

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 Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!