File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Testing and the fly likes Element is not currently visible issue Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Engineering » Testing
Bookmark "Element is not currently visible issue" Watch "Element is not currently visible issue" New topic

Element is not currently visible issue

Laura Morley

Joined: Sep 30, 2013
Posts: 8
Got some what further with my code and now stuck. I have asked two people who know Java and they dont know what the problem is, so I am hoping someone on here might be able to help..

I have a drop down box. This drop down box has two elements in a list "Laura" "Clare"

I have given the details for it to select "Laura" but I am getting this error

Exception in thread "main" org.openqa.selenium.ElementNotVisibleException: Element is not currently visible and so may not be interacted with

First of all, what does this error mean?
Second of all, how am I supposed to fix it? This is my code and also the details of the dropdown box for "Laura"

Dropdown box:
Matthew Brown

Joined: Apr 06, 2010
Posts: 4542

I've not used Selenium in this context, but I can have a guess.

Firstly, note that you're searching for an element with id "boundlist-1146-listEl", but the HTML you're showing doesn't show any element like that. Presumably it's supposed to be the container for what you've shown us.

Anyway, based on the error message, it sounds like you're trying to get Selenium to simulate a click on an element that is not currently showing on the interface. It's trying to simulate a user, and a user can't click on something they can't see.

So I'd expect to see a message like that if I had, for example, a popup menu, and I was trying to click on an item in a menu when that menu wasn't actually "popped up". Is that list item supposed to be visible all the time? If not, it looks like you aren't triggering whatever it is that will make it visible.
Laura Morley

Joined: Sep 30, 2013
Posts: 8
HI Matthew
Thank you for your reply. I think I havent copied over everything. I will re do it

This is the xPath : .//*[@id='boundlist-1146-listEl']/ul/li[1]

The drop down list is visible as I have created the click to pull it down. That works fine. I have now tried with a 5 second wait but still nothing.

I am very confused why it cannot see it
Doug Slavens

Joined: Sep 10, 2013
Posts: 11
The id attribute maybe the problem. If you are using selenium to automate a script on an application like DevTrack, DevTest or Jira, that id is probably dynamically created could change every time the page is loaded (the number 1146 could be 2497 on the next page load). If you use the Selenium IDE to capture that element, look at the target for the select command and see if there are other choices besides the id attribute to identify the select. You might have a class or name attribute you could use.
I agree. Here's the link:
subject: Element is not currently visible issue
It's not a secret anymore!