Skip to content
Advertisement

How to exit dropdown menu in selenium webdriver

I am using selenium webdriver with Chrome. I am able to select item from dropdown menu and it works fine.

But it there is no item in dropdown items after that I cannot select any other field.

I put this is try catch block so it goes to next steps. If I try to select other field and sendKeys it still adds text to dropdown search bar.

And after that when I try to click on button I get error:

WebDriverException: Message: unknown error: Element is not clickable at point (698, 686). Other element would receive the click: 
  (Session info: chrome=47.0.2526.80)

I can see in UI that cursor stays at dropdown search bar. How can I exit it? I tried to click on it again to minimize it but it wouldn’t

Advertisement

Answer

Yes moving focus worked. Previously I was trying to do find_element...click() that didn’t worked. But below did !! ActionChains(self.driver).move_to_element(self.driver.find_element_by_name('name')).click().perform()

User contributions licensed under: CC BY-SA
4 People found this is helpful
Advertisement