org.openqa.selenium.ElementNotVisibleException: Element is not currently visible and so may not be interacted with

63 views
Skip to first unread message

Pankaj Tiwari

unread,
May 26, 2017, 4:52:12 AM5/26/17
to seleniu...@googlegroups.com
Hi All,

I am facing an issue while clicking on a menu which appears while click/mousehover on a button. i am able to open that menu but unable to click on that element.

The HTML for that element is hidden. See below screenshot for reference for html of the element.


Inline image 1


I have tried many solutions mentioned in below links but nothing is working for me.

https://stackoverflow.com/questions/6101461/how-to-force-selenium-webdriver-to-click-on-element-which-is-not-currently-visib


https://stackoverflow.com/questions/20355515/how-to-do-a-mouse-over-using-selenium-webdriver-to-see-the-hidden-menu-without-p


thi...@thoughtworks.com

unread,
May 26, 2017, 12:00:28 PM5/26/17
to Selenium Users
Hi,
Its quite confusing for me..Are you trying to click on the button or on an element inside the menu that appears after clicking on button?
A screenshot of the action too helps if possible..

Pankaj Tiwari

unread,
May 26, 2017, 3:49:02 PM5/26/17
to seleniu...@googlegroups.com
Hi ,

I can't upload the screenshot as its confidential. Its a menu which have 4 options and it comes when i click/mousehove on a button.  I am able to click on that button after that menu opens but unable to select the option from that menu.

As you can see in above screenshot, the html for that menu is always hidden that's why i am getting org.openqa.selenium.ElementNotVisibleException: Element is not currently visible and so may not be interacted with becuase selenium is not interact with hidden elements.

I have tried with mousehover method of Actions class. Tried with JavaScriptExecutor as well but nothing is working... 




--
You received this message because you are subscribed to the Google Groups "Selenium Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to selenium-users+unsubscribe@googlegroups.com.
To post to this group, send email to selenium-users@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/selenium-users/92da324e-4b0a-4f12-81e9-7515d340570e%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

thi...@thoughtworks.com

unread,
May 29, 2017, 1:52:10 AM5/29/17
to Selenium Users
Hi,
Are the drop down options in a select list?If yes,did you try selenium select option if its a select drop down list?
Also,try to wait for sometime for the drop down items to get enabled or visible if there is time lag..
If these doent work, Can you expand the drop down items and attach the above screenshot again?Also the stacktrace of where you get exception...



On Saturday, May 27, 2017 at 1:19:02 AM UTC+5:30, Pankaj Tiwari wrote:
Hi ,

I can't upload the screenshot as its confidential. Its a menu which have 4 options and it comes when i click/mousehove on a button.  I am able to click on that button after that menu opens but unable to select the option from that menu.

As you can see in above screenshot, the html for that menu is always hidden that's why i am getting org.openqa.selenium.ElementNotVisibleException: Element is not currently visible and so may not be interacted with becuase selenium is not interact with hidden elements.

I have tried with mousehover method of Actions class. Tried with JavaScriptExecutor as well but nothing is working... 



On Fri, May 26, 2017 at 9:30 PM, <thi...@thoughtworks.com> wrote:
Hi,
Its quite confusing for me..Are you trying to click on the button or on an element inside the menu that appears after clicking on button?
A screenshot of the action too helps if possible..


On Friday, May 26, 2017 at 2:22:12 PM UTC+5:30, Pankaj Tiwari wrote:
Hi All,

I am facing an issue while clicking on a menu which appears while click/mousehover on a button. i am able to open that menu but unable to click on that element.

The HTML for that element is hidden. See below screenshot for reference for html of the element.


Inline image 1


I have tried many solutions mentioned in below links but nothing is working for me.

https://stackoverflow.com/questions/6101461/how-to-force-selenium-webdriver-to-click-on-element-which-is-not-currently-visib


https://stackoverflow.com/questions/20355515/how-to-do-a-mouse-over-using-selenium-webdriver-to-see-the-hidden-menu-without-p


--
You received this message because you are subscribed to the Google Groups "Selenium Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to selenium-user...@googlegroups.com.
To post to this group, send email to seleniu...@googlegroups.com.

Pankaj Tiwari

unread,
May 29, 2017, 2:45:55 PM5/29/17
to seleniu...@googlegroups.com
Hi, 

Its not a drop*down list.. Its just a simple list which comes after hovering mouse on a element. The html for that list is is not getting visible due to this i am getting this exception. 

I have created xpath for that list and i am also able to locate that html while verifying with IDE but when i am using it in my webdriver script its not working and getting the exception.

To unsubscribe from this group and stop receiving emails from it, send an email to selenium-users+unsubscribe@googlegroups.com.
To post to this group, send email to selenium-users@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/selenium-users/2e65ade2-8b24-4e71-a822-883bbba5b6b8%40googlegroups.com.
Reply all
Reply to author
Forward
0 new messages