The following code works perfectly when an element is present in DOM and visible in the viewport:
WebElement button = webdriver.findElement(By.id("myButton"));
But, I don't understand why it throws an exception when the button is present in the DOM but not visible in the viewport.
I know for sure that the button is present: there is no ajax in play here.
How can I test for an element to be present in the DOM whether or not it is visible in the viewport?
I already saw some usefull links here on stackoverflow:
https://stackoverflow.com/a/44916498/420593
How to check if an element is into view using Selenium WebDriver?