I am trying to automate upload file functionality in Google Drive. The element used to pass parameters is hidden with height - 0px. None of the user actions would make this element visible. So I need a workaround to click on the element while it is not visible.
<input type="file" style="height: 0px; visibility: hidden; position: absolute; width: 340px; font-size: inherit;" multiple=""/>
The XPath for the above element is -
*[@class='goog-menu goog-menu-vertical uploadmenu density-tiny']/input
I am using
WebDriver.findElement(By.xpath(<xpath>).sendKeys(<uploadFile>)
Exception -
org.openqa.selenium.ElementNotVisibleException
Element is not currently visible and so may not be interacted with.
I have tried using JavascriptExecutor. But unable to find the exact syntax.