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