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?
asked Oct 1, 2015 at 19:17
-
Looks like this thread may be helpful: stackoverflow.com/questions/22110282/…Adam Sova– Adam Sova2015年10月01日 19:25:57 +00:00Commented Oct 1, 2015 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 stackoverflow.com/questions/32890596/…EGHM– EGHM2015年10月01日 19:29:02 +00:00Commented Oct 1, 2015 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– Jinal Shah2015年10月02日 21:00:57 +00:00Commented Oct 2, 2015 at 21:00
-
Please read the guide How do I ask a good question, 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– JeffC2015年10月05日 00:43:15 +00:00Commented Oct 5, 2015 at 0:43
1 Answer 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);
Comments
lang-java