Selenium Webdriver – click on hidden elements
Try this: WebElement elem = yourWebDriverInstance.findElement(By.xpath(“//*[@class=”goog-menu goog-menu-vertical uploadmenu density-tiny”]/input”)); String js = “arguments[0].style.height=”auto”; arguments[0].style.visibility=’visible’;”; ((JavascriptExecutor) yourWebDriverInstance).executeScript(js, elem); The above bunch would change the visibility of your file input control. You can then proceed with the usual steps for file upload like: elem.sendKeys(“<LOCAL FILE PATH>”); Be aware, by changing the visibility of an input field you … Read more