Selenium ElementNotVisibleException
Selenium ElementNotVisibleException is also one of the frequent exceptions which we will face in selenium webdriver while automating any kind of application. This exception tells you that the WebElement that you are trying to interact with is not visible to the user. If the element is not visible to the user then they are not going to able to interact with it.
Below are the causes to face this exception:
Thrown to indicate that although an element is present on the DOM, it is not visible, and so is not able to be interacted with. To overcome this kind of situation we need to use synchronization concept in selenium. So, add an explicit wait to wait for the correct conditions to be met before trying to interact with the element. We have an option to use wait in so many ways or conditions. Will make use of all those things depends on the situation and will try to resolve or handle these type of scenarios.
Sometimes if the element is there on the web page and not in the visible area then also you can find this type of exception. To overcome this situation we need to scroll to that particular web element first then you can interact with that element to resolve this type of exception. Most of the times selenium webdriver will take care of this situation that it will find the element which is not there on the visible area and it will interact with that element. But some times, if the situation comes, then we need to scroll to the particular web element or scroll in the webpage and then can interact with the required element.
This way we can overcome the ElementNotVisibleException in selenium webdriver.
Please watch the YouTube video for this blog for better understanding.