AboveTustin
AboveTustin copied to clipboard
Screenshot can fail when there are lots of aircraft
It looks like screenshot.clickOnAirplane
can fail if there are so many aircraft in the list that the one it's trying to click on has scrolled below the visible portion of the window. The error is
selenium.common.exceptions.ElementNotVisibleException: Message: {"errorMessage":"Element is not currently visible and may not be manipulated", ...}
This stackoverflow post has an idea for a workaround, which is to run javascript in the headless browser that causes the click to occur whether the element is visible or not:
JavascriptExecutor jsx = (JavascriptExecutor)driver;
jsx.executeScript("arguments[0].click();", element);