-1

I have a dropdown which is hidden at the moment it loads and with a button click it is set to visible and I can see it when the selenium is running it in the browser but still it gives me this exception

org.openqa.selenium.WebDriverException: ElementNotVisibleError: Element is not currently visible and may not be manipulated'ElementNotVisibleError: Element is not currently visible and may not be manipulated' when calling method: [wdIMouse::click] Command duration or timeout: 47 milliseconds

Can someone suggest how we can resolve this?

Jinal Shah
  • 325
  • 3
  • 15
  • Looks like this thread may be helpful: http://stackoverflow.com/questions/22110282/how-to-click-on-hidden-element-in-selenium-webdriver – Adam Sova Oct 01 '15 at 19:25
  • Before trying Adam's suggestion I'ld verify that you are giving the selection enough time to appear. You could quickly throw a Thread.sleep(3000) in there and if that resolves the problem, fix it properly with something like the answer for http://stackoverflow.com/questions/32890596/webdriver-assertions-fail-after-swicthing-to-java-8 – EGHM Oct 01 '15 at 19:29
  • Adam and EGHM I have tried both the approach but nothing works. I tried selecting by visible text but still doesn't work. – Jinal Shah Oct 02 '15 at 21:00
  • Please read the guide [How do I ask a good question](http://stackoverflow.com/help/how-to-ask), especially the part on Minimal, Complete, and Verifiable example (MCVE). This will help you solve problems for yourself. If you do this and are still stuck you can come back and post your MCVE, what you tried, and what the results were so we can better help you. – JeffC Oct 05 '15 at 00:43

1 Answers1

-1

Try using Actions and WebDriverWait

Maybe something like this

Actions builder = new Actions(driver);
WebDriverWait wait = new WebDriverWait(driver);

Action clickTheDropDown = builder.moveToElement(dd).Click(otherElement).build();

clickTheDropDown.perform();
wait.Until(Expectedcondition.VisibilityOfElement(dd);
terle
  • 86
  • 10